SirHaschke Posted October 31, 2008 Author Posted October 31, 2008 (edited) OK.And is it possible to work with variables like %wpipath% in the batch file or only in WPI directly?I have a software that restarts the workstation.After the restart continues WPI with the installation at the point after the restart? Edited October 31, 2008 by SirHaschke
chaoticyeshua Posted October 31, 2008 Posted October 31, 2008 (edited) When you're using a batch to call a setup, do this%~dp0Setup.exeThis would run Setup.exe from the directory your batch script is located in, but this would also allow you to use the batch file easily without WPI. Is that what you're needing? Edited October 31, 2008 by chaoticyeshua
SirHaschke Posted October 31, 2008 Author Posted October 31, 2008 I don't know the parameter %~dp0Setup.exe.I try to explain it.This is my command line in WPI:"%wpipath%\Install\VA\Rechte.bat"This is the content of the "Rechte.bat" file:D:\WPI\Tools\xcacls.exe "C:\Programme\AQS_GKIS_MISVA" /T /E /C /G Jeder:F;FD:\WPI\Tools\xcacls.exe "C:\Dokumente und Einstellungen\All Users\Desktop" /T /E /C /G Jeder:F;FBut in the batch file is D:\ (my CD drive).WPI works with %wpipath% and it does not matter if the drive is D:\ or E:\.Is it possible to work with a variable in my batch file?
chaoticyeshua Posted November 3, 2008 Posted November 3, 2008 %~dp0 is a variable that leads to the path where the batch script is run from. If you put xcacls.exe in the same directory as your batch script (\WPI\Install\VA) then you can just do this:%~dp0xcacls.exe "C:\Programme\AQS_GKIS_MISVA" /T /E /C /G Jeder:F;F
SirHaschke Posted November 4, 2008 Author Posted November 4, 2008 I put this line in WPI%~dp0xcacls.exe "C:\Programme\AQS_GKIS_MISVA" /T /E /C /G Jeder:F;Fand put xcacls.exe in the same directory of my batch file. But it doesn' work :-(.Why?Now i put this in the command line of WPI"%wpipath%\Install\VA\Rechte.bat"This is the content of my Rechte.bat:cd %cd%cd Installcd VAxcacls.exe "C:\Programme\AQS_GKIS_MISVA" /T /E /C /G Jeder:F;Fxcacls.exe "C:\Dokumente und Einstellungen\All Users\Desktop" /T /E /C /G Jeder:F;FThis works fine.......
chaoticyeshua Posted November 4, 2008 Posted November 4, 2008 (edited) Hmmmm... I don't know why %~dp0 doesn't work for you. It works fine for me. I put xcacls.exe in a path with spaces and it even worked by doing this: "%~dp0"xcacls.exeBut your path doesn't have spaces, so it should work anyway. You could always just search for a file on the root of the CD to set the %cdrom% variable. You can do that by using this:FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\whateverfile.fil SET CDROM=%%i:If WPI.hta is the file you're searching for, then change whateverfile.fil to WPI.hta... then you can use %CDROM% as a variable pointing to the root of your CD. But if you've already got it working, then good Edited November 4, 2008 by chaoticyeshua
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now