How to reboot a Windows System using WMI ?

0

If you know the administrator password of a system that you are authorized to use, you can use this function to reboot it for some automation needs. please do not try this on systems that you are not authorized to use. I have shown only the function definition here. You can use this in a QTP function library.
Continue reading

Executing a command on a remote windows system using WMI

3

Usually we use psexec tool from sysinternals to execute any program on a remote system. There is another way to execute a command on a remote windows system via WMI (Windows Management Instrumentation). This function would be beneficial to QTP automators because its a vbscript function and can be used in their function libraries (after some modifications). All you have to do is call this function with the target system name, username, password and the command to execute. The output would be the process if of the process that was initated on the target system. Have fun…

  Continue reading

Determine the mapped drives on QTP Client

0

You can use WMI Class Win32_LogicalDisk to find that out. With this class not only can we determine which drives are mapped to network shares, but we can also determine which network shares they map to. Please note that the DriveType equal to 4 represents a mapped network drive. For more details about Drivetype values, refer the WMI SDK. The WMI query returns a collection of mapped drives. DeviceID, which returns the drive letter for the drive; and ProviderName, which returns the network share the drive is mapped to .
Continue reading

Check status of a windows service on a remote system using WMI

1

In the automation world, you may be required to check whether the product that you wanted to test is installed and the application service is running properly.  You could use the below code to accomplish that. You could add this to a function library and associate it with QTP test. Then call the function with appropriate test parameters. For example :

Continue reading