New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
134 views

How can I launch a .bat or .exe from a script?

Performance Center 9.5.2 - I have the following in a script:

This statement works:
system("copy c:\\test.bat c:\\test.bak");

These do not launch the application. Note: c:\ is in the path.
system("c:\\test.bat");
system("test.bat");

Is this something to do with desktop interaction?
0 Likes
4 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

If the batch file is on the local machine where the script is running the first system call should work.
0 Likes
Highlighted
Absent Member.
Absent Member.

The script is executed from the controller on an agent machine. The copy works, trying to launch the batch file does nothing (nothing shows on the desktop and no processes start in task manager.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

The script runs on the load generator. Is the file there? It has to be on each of your load generators.
0 Likes
Absent Member.
Absent Member.

Yes. The batch file is in the root drive of the machine the script is executing on. To demonstrate, if all 3 lines are in the script, the copy works (copy c:\test.bat c:\test.bak) but trying to run the batch file does nothing.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.