Search This Blog

Wednesday 16 January 2013

Finding RAM size using QTP Program?

Dim Wshshell,fso,fo,l
''Open the CMD Prompt
set WshShell = CreateObject("WScript.Shell")
SystemUtil.run "cmd.exe"
wait(2)
'cmd="systeminfo |find"
'cmd1="Total Physical Memory:"
'WshShell.SendKeys cmd &" "&"""" &cmd1&""""
WshShell.SendKeys "systeminfo |find"&" "&""""&"Total Physical Memory:"&""""&">D:\Sys.txt"
WshShell.SendKeys "~"
wait(3)

WshShell.SendKeys "exit"
WshShell.SendKeys "~"


                        Set fso=createobject("scripting.filesystemobject")
                        Set fo=fso.opentextfile("D:\Sys.txt")
While fo.AtEndOfStream<>true
                                    l=fo.readline
                                    MsgBox l
                        wend
                        fo.close
                        set fo=nothing
                        set fso=nothing

1 comment: