Jump to content

Recommended Posts

Posted (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 by SirHaschke

Posted (edited)

When you're using a batch to call a setup, do this

%~dp0Setup.exe

This 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 by chaoticyeshua
Posted

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;F

D:\WPI\Tools\xcacls.exe "C:\Dokumente und Einstellungen\All Users\Desktop" /T /E /C /G Jeder:F;F

But 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?

Posted

%~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

Posted

I put this line in WPI

%~dp0xcacls.exe "C:\Programme\AQS_GKIS_MISVA" /T /E /C /G Jeder:F;F

and 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 Install

cd VA

xcacls.exe "C:\Programme\AQS_GKIS_MISVA" /T /E /C /G Jeder:F;F

xcacls.exe "C:\Dokumente und Einstellungen\All Users\Desktop" /T /E /C /G Jeder:F;F

This works fine.......

Posted (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.exe

But 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 by chaoticyeshua

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...