Forum Discussion
tristaanogre
6 years agoEsteemed Contributor
Running batches using WshShell does not return an output from the console. The "Run" method simply returns any integer error code returned from the command being executed.
Something to consider for testing purposes. In the command for your WshShell.Run, you can "pipe" the output to a file (I used to do this mumble-mumble years ago when I was working in MS-DOS 6.22). Then, you can read the contents of the file using an aqFile method and verify the contents that way.
The following function (written in JavaScript) will redirect the output of the indicated batch file into the indicated file in what is configured as the "current directory".
function blah(){ WshShell.CurrentDirectory = Project.Path + '\\Script\\'; WshShell.Exec(Project.Path + '\\Script\\testfile.bat > test.txt'); }
Note I'm using Exec instead of Run but the same will work for Run
Related Content
- 2 years agoTestQA1
- 2 years agopstachelek
- 3 years agoEgg
Recent Discussions
- 2 days agovladd1