amelio Posted January 21, 2014 Posted January 21, 2014 (edited) 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 warningBatch 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=83383Please help me, thank youconfig.jsjava_x86.cmd Edited January 21, 2014 by amelio
myselfidem Posted January 21, 2014 Posted January 21, 2014 (edited) You need to download the exe file (Offline installer), here:http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.htmlTry to use the switches:jre-7u51-windows-i586.exe /s /v "/qn"Hope that help! Edited January 21, 2014 by myselfidem
amelio Posted January 21, 2014 Author Posted January 21, 2014 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...
WAndrey Posted January 21, 2014 Posted January 21, 2014 start /wait "%~dp0jre-7u45-windows-i586.exe" IEXPLORER=1 ADDLOCAL=ALL /s /NoRestart
amelio Posted January 21, 2014 Author Posted January 21, 2014 start /wait "%~dp0jre-7u45-windows-i586.exe" IEXPLORER=1 ADDLOCAL=ALL /s /NoRestartThank 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
WAndrey Posted January 23, 2014 Posted January 23, 2014 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.
amelio Posted January 24, 2014 Author Posted January 24, 2014 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?
Kelsenellenelvian Posted January 24, 2014 Posted January 24, 2014 Wpi sets a path variable when it starts and everything is run as a child from wpi so it makes sense that cmd without a path would get messed up
ejimatsu Posted March 28, 2014 Posted March 28, 2014 (edited) {START} cmd /c "%wpipath%\Install\Filefolder\batchname.cmd"exsample{START} cmd /c "%wpipath%\\Install\\Office2007SP1slip\\setup.bat" Edited March 28, 2014 by ejimatsu
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now