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. ×

WPI and batch files


 Share

Recommended Posts

Hi, i have a question about using a cmd or bat file in WPI.

I've read all documentation about {BATCH} command using it {BATCH} "%wpipath%\Install\Filefolder\batchname.cmd"

My batch works perfectly if i run it directly from cmd file but if i use wpi i see this warning

wpi1.jpg

Batch doesn't find exe file, but cmd is correct...

I attach config.js script and batch file (to work it needs latest javax86 installer http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383

Please help me, thank you

config.js

java_x86.cmd

Edited by amelio
Link to comment
Share on other sites


Cmd is correct, it works if i run it manually from WPI install folder but if i run it via WPI it doesn't find exe file in the folder...
I suppose i've used a bad command in wpi but i can't find solution...

Link to comment
Share on other sites

start /wait "%~dp0jre-7u45-windows-i586.exe" IEXPLORER=1 ADDLOCAL=ALL /s /NoRestart

Thank you WAndrey, it works!

This is a WPI bug? Why we must add %~dp0 to a working cmd file?

Is possible to solve via config file this issue?

Thank you for this great tool :)

Link to comment
Share on other sites

No, it's not a bug WPI.

The %~dp0 (that’s a zero) variable when referenced within a Windows batch file will expand to the drive letter and path of that batch file.
The variables %0-%9 refer to the command line parameters of the batch file. %1-%9 refer to command line arguments after the batch file name. %0 refers to the batch file itself.
If you follow the percent character (%) with a tilde character (~), you can insert a modifier(s) before the parameter number to alter the way the variable is expanded. The d modifier expands to the drive letter and the p modifier expands to the path of the parameter.

Start command starts a separate Command Prompt window to run a specified program or command.

Since you do not specify a parameter /d Path specifies the startup directory, there is no guarantee that it will coincide with the location of your command file. Therefore, we specify the full path using the variable modifiers.

Sorry for my english.

Link to comment
Share on other sites

WAndrey, i've read documentation about %~dp but if i have a batch file and i launch it from cmd file without %~dp variable it works on my pc but if i use it via WPI i must add the variable to make it workable...

Why WPI needs this variable?

Link to comment
Share on other sites

  • 2 months later...

{START} cmd /c "%wpipath%\Install\Filefolder\batchname.cmd"

exsample

{START} cmd /c "%wpipath%\\Install\\Office2007SP1slip\\setup.bat"

Edited by ejimatsu
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...