Running batch file instead of EXE file for Generic Test

JunaidSye

Running batch file instead of EXE file for Generic Test

by JunaidSye » Sun, 28 Dec 2008 21:23:33

How can i run a batch file instead of .exe file from generic test. In some book it says "to run batch file use the syntax C:\Windows\System\cmd.exe /c[batchfile].

Can anyone elaborate what does \c means please and if possible post an example for how to run the batch file.


Thanks!


Guillermo Serrato - MSF

Running batch file instead of EXE file for Generic Test

by Guillermo Serrato - MSF » Tue, 30 Dec 2008 22:24:34

Hi,

You can find information about cmd.exe parameters here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx mfr=true

It basically runs your batch file, then exists cmd.exe.

an example is cmd.exe /c mybatchfile.bat

hope this helps

Guillermo Serrato

VS Team Test



Guillermo Serrato - MSF

Running batch file instead of EXE file for Generic Test

by Guillermo Serrato - MSF » Thu, 01 Jan 2009 00:26:36

Hi sorry for the late reply,

you might need to use quotes so that commandline will interpret it correctly.

Hope this helps

Guillermo Serrato

VS Team Test




JunaidSye

Running batch file instead of EXE file for Generic Test

by JunaidSye » Thu, 01 Jan 2009 23:25:35

I understand the example and tried this but this doesn't work. For example i want to run a batch file that have directory structure like this C:\MyFolder\xyz.bat and when i di C:\Windows\system32\cmd.exe /c C:\MyFolder\xyz.bat. It gives me an error Invalid Program name. Please let me know what am i doing wrong


Thanks

JunaidSye

Running batch file instead of EXE file for Generic Test

by JunaidSye » Sat, 03 Jan 2009 01:27:37

Quotes around entire thing! Please can u write it down how exactly i should do it.

Thanks

Guillermo Serrato - MSF

Running batch file instead of EXE file for Generic Test

by Guillermo Serrato - MSF » Mon, 05 Jan 2009 02:28:38

Ok,

So in the generic test, you would do the following:

Program: "C:\Windows\system32\cmd.exe"

Command-line arguments: /c "C:\MyFolder\xyz.bat"

This should work for you

Thanks

Guillermo Serrato

VS Team Test