Skip to main content

Posts

Showing posts with the label Windows Automation

Keep your windows machine Unlock while QTP Running.

Below are the Few ways to  Keep your windows machine Unlock: Way 1: Install the Caffeine 1.4 software on machine where u run the scripts.  =========================================================================== Way 2: Create a .vbs file with the below code and run the script using task scheduler Const DELAY_MINUTES = 10 Wscript.Sleep DELAY_MINUTES * 60000 Do    CreateObject(“Wscript.Shell”).SendKeys “+”    Wscript.Sleep DELAY_MINUTES * 60000 Loop ===========================================================================  Way 3: Create a .vbs file with the below code and run the script Const micVoid = 0 Const micByte = 26 Const micLong = 3 Const KEYEVENTF_KEYUP = &H2 Set Extern = CreateObject("Mercury.ExternObj") extern.Declare micVoid, "keybd_event", "user32", "keybd_event", micByte, micbyte, miclong, micLong Extern.Declare micVoid, "Sleep", "kernel32", "Sleep", micLon...

How to get installed programs from Registry

Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE strComputer = "." strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" strEntry1a = "DisplayName" strEntry1b = "QuietDisplayName" strEntry2 = "InstallDate" strEntry3 = "VersionMajor" strEntry4 = "VersionMinor" strEntry5 = "EstimatedSize" Set objReg = GetObject("winmgmts//" & strComputer & "/root/defaultStdRegProv")                                        (oR )   Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _     & strComputer & "\root\default:StdRegProv") objReg.EnumKey HKLM, strKey, arrSubkeys Print  "Installed Applications" & VbCrLf For Each strSubkey In arrSubkeys   intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _    strEntry1a, strValue1) ...

How to get installed programs in Control Panel

Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile("c:\software.txt", True) strComputer = "." Set objWMIService = GetObject("winmgmts:" _     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery _     ("Select * from Win32_Product") objTextFile.WriteLine "Caption" & vbtab & _     "Description" & vbtab & "Identifying Number" & vbtab & _     "Install Date" & vbtab & "Install Location" & vbtab & _     "Install State" & vbtab & "Name" & vbtab & _     "Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _         & "Version" For Each objSoftware in colSoftware     objTextFile.WriteLine objSoftware.Caption ...