MSFN Forum: Using WPI for launching batch scripts - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Using WPI for launching batch scripts Using WPI for launching batch scripts Rate Topic: -----

#1 User is offline   kevinbryant69 

  • Group: Members
  • Posts: 3
  • Joined: 17-November 11
  • OS:none specified
  • Country: Country Flag

Posted 17 November 2011 - 03:26 PM

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,

Kevin


#2 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,342
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 17 November 2011 - 04:07 PM

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.

This post has been edited by Kelsenellenelvian: 17 November 2011 - 04:08 PM


#3 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,342
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 17 November 2011 - 04:34 PM

I have added the dos sub-command of {BATCH} to the commandwizard for the next version.

Then you com lines would be - {BATCH} "%wpipath%\install\batch1.cmd"

#4 User is offline   mritter 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,091
  • Joined: 13-November 05
  • OS:none specified
  • Country: Country Flag

Posted 17 November 2011 - 06:04 PM

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) != '"')
			cmd='"'+cmd+'"';
		if (programs[item].bit64=="yes" && OSBits==64)
			cmd='"'+sysPath64+'cmd.exe" /C '+cmd;
		else
			cmd='"'+sysPath32+'cmd.exe" /C '+cmd;

		return cmd;
	}




#5 User is offline   kevinbryant69 

  • Group: Members
  • Posts: 3
  • Joined: 17-November 11
  • OS:none specified
  • Country: Country Flag

Posted 21 November 2011 - 09:01 AM

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?

#6 User is offline   kevinbryant69 

  • Group: Members
  • Posts: 3
  • Joined: 17-November 11
  • OS:none specified
  • Country: Country Flag

Posted 21 November 2011 - 10:18 AM

I changed the network resource to a local mapped drive and that seems to take care of some issues but some scripts still do not execute properly.

#7 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,342
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 21 November 2011 - 12:34 PM

WPI doesn't recognize enviroment variables like that.

They have to be coded in.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy