Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

Using WPI for launching batch scripts

Recommended Posts

I have a lot of batch scripts that I must run repeatedly in different combinations on different OSs. I think that WPI would be a perfect tool for this. I am however having trouble getting WPI to launch batch scripts. It will launch an executable just fine but always gives an error when trying to launch a batch file. The error is not very descriptive. I have very little java/html/vbs experiance. I can poke around at the code and figure some things out, but for the most part my skills lie in batch scripting. Can anyone help me figure this out? At this moment I am testing this on windows 7 pro 32bit.

thanks in advance,


Link to post
Share on other sites

Please add before each commandline when selecting a command cmd /c

So your cmdline would be = cmd /c "%wpipath%\install\batch1.cmd"

Also please remember WPI is not free for buisness or corporation uses.

Edited by Kelsenellenelvian
Link to post
Share on other sites

Careful with that new command. Build it around the existing code in installer.js to handle x86 and x64 properly. I was going to do it but no key stroke savings.

if (cmd.indexOf(".cmd") != -1 || cmd.indexOf(".bat") != -1)
if (cmd.indexOf(" ") != -1 && cmd.substr(0,1) != '"')
if (programs[item].bit64=="yes" && OSBits==64)
cmd='"'+sysPath64+'cmd.exe" /C '+cmd;
cmd='"'+sysPath32+'cmd.exe" /C '+cmd;

return cmd;

Link to post
Share on other sites

Thanks for the replies.

How much does WPI cost for none private use?

Also I am trying to add that to my command line and its not working. My command line looks like this,

cmd /c "%gamesrc%\Batch files\Batch1.cmd"

I changed the default path to match my environment variable of %gamesrc%. All I get is a command windows for just a split second, too fast to read and then the installer bar goes all the way to 100% then an error icon pops up on the list and it exits and restart WPI.

Any more advice?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...