06-19-2012, 12:03 PM
06-19-2012, 12:17 PM
I am not getting any error.
Can you brief out exactly what are you trying to do ?
Can you brief out exactly what are you trying to do ?
06-19-2012, 01:34 PM
'Create a description for browser
After executing the above code I am getting the error as "Object required 'Description'
Code:
Set oBrowser = Description.Create
oBrowser("micclass").Value = "Browser"
'Get all browsers
Set allBrowser = Desktop.ChildObjects(oBrowser)
Dim i, iCount
iCount = allBrowser.Count - 1
For i = 0 To iCount
allBrowser(i).Close
Next
After executing the above code I am getting the error as "Object required 'Description'
06-19-2012, 02:04 PM
I tried ur code and it is perfectly working.
R u executing the below thru QTP or .vbs file ?
R u executing the below thru QTP or .vbs file ?
06-19-2012, 03:37 PM
I am not using QTP. I am using .vbs file.
06-19-2012, 05:30 PM
I think Description.Create does not support in .vbs file as it belongs to QTP.
Try below code to close all browsers thru .vbs file
Try below code to close all browsers thru .vbs file
Code:
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colProcesses = objWMIService.ExecQuery( "Select * from Win32_Process where name = 'iexplore.exe'")
For Each objProcess in colProcesses
objprocess.terminate
Next
Set colProcesses = Nothing
Set objWMIService = Nothing