Radar
13 years agoOccasional Contributor
Query Schedule Task On Remote Virtual Machine
We have a testing environment which comprises a number of VM's that represent our production system.
TestComplete resides on its own XP VM in this environment, however is part of a Workgroup and is not on the Domain with the VM's that make up the system.
What I am trying to do is check if a Schedule Task exists on one of the remote VM's in the environment. I am trying to achieve this by doing the following:
[JScript]
var remoteServer = "\\\\AMIPSP01"
var userName = "user";
var passWord = "password";
var computerName = aqEnvironment.GetEnvironmentVariable("COMPUTERNAME");
var tempPath = aqEnvironment.GetEnvironmentVariable("TEMP");
var fullTempPath = LongPathName(tempPath); //function to convert the short path name to a long path name
var tempDir = aqString.Replace(fullTempPath, ":","$");
var fileName = "\\\\"+computerName+"\\"+tempDir+"\\SchduleTaskList.csv";
var cmdString = "SCHTASKS /Query /S "+remoteServer+" /U "+userName+" /P "+passWord+" /FO CSV >> "+fileName;
var processID = WMI.CreateProcess(cmdString);
I ave tried this script an a number of variations, however have not been able to generate a file listing the scheduled tasks.
Your help will be appreciated.
Regards
Mark
TestComplete resides on its own XP VM in this environment, however is part of a Workgroup and is not on the Domain with the VM's that make up the system.
What I am trying to do is check if a Schedule Task exists on one of the remote VM's in the environment. I am trying to achieve this by doing the following:
[JScript]
var remoteServer = "\\\\AMIPSP01"
var userName = "user";
var passWord = "password";
var computerName = aqEnvironment.GetEnvironmentVariable("COMPUTERNAME");
var tempPath = aqEnvironment.GetEnvironmentVariable("TEMP");
var fullTempPath = LongPathName(tempPath); //function to convert the short path name to a long path name
var tempDir = aqString.Replace(fullTempPath, ":","$");
var fileName = "\\\\"+computerName+"\\"+tempDir+"\\SchduleTaskList.csv";
var cmdString = "SCHTASKS /Query /S "+remoteServer+" /U "+userName+" /P "+passWord+" /FO CSV >> "+fileName;
var processID = WMI.CreateProcess(cmdString);
I ave tried this script an a number of variations, however have not been able to generate a file listing the scheduled tasks.
Your help will be appreciated.
Regards
Mark