Jump to content

Runing WPI From, USB HDD


Recommended Posts

Hi all,

i tend to install all my applications after (unattended) windows has loaded to the desktop

for this i use WPI from a "USB HDD"

the problem i have had in the past is that i cannot use a %CDROM% variable when using a .cmd file with XCOPY to copy over a file to the %systemdrive% from within WPI

so what i have done is to use the %LocalDisk% variable

here is the code (WPI) config.js -part of-

prog[pn]=['Audacity'];
ordr[pn]=[17];
desc[pn]=['Create Music or Change File Extensions'];
uid[pn]=['AUDACITY'];
dflt[pn]=['no'];
cat[pn]=['MultiMedia'];
forc[pn]=['no'];
cmd1[pn]=['%WPIPATH%\\APPS\\Audacity\\Audacity126.exe /SILENT /SP-'];
cmd2[pn]=['%WPIPATH%\\APPS\\Audacity\\Audacity.cmd'];
pn++;

here is the (CMD) Audacity.cmd

cmdow @ /HID
@Echo Off

MKDIR "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\"

XCOPY /Q "%LocalDisk%\WPI\APPS\Audacity\lame_enc.dll" "%SYSTEMDRIVE%\Program Files\Audacity\" /Y
XCOPY /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity.lnk" "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\" /Y

DEL /Q /F "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity.lnk"
DEL /Q /F "%USERPROFILE%\Desktop\Audacity.lnk"

if you look at the line -

XCOPY /Q "%LocalDisk%\WPI\APPS\Audacity\lame_enc.dll" "%SYSTEMDRIVE%\Program Files\Audacity\" /Y

you will notice that the "DRIVE" variable is %LocalDisk% - this seems to be the only code that is needed to set the path to the "USB HDD" to run the XCOPY "some file" from the usb drive

if this has been discused before accept my apologys, if not then someone might find it usefull

regards, amd64

Edited by amd64
Link to comment
Share on other sites


The reason you cannot use %CDROM% within your .cmd file is because it is a WPI variable, not a ms-dos variable. A quick fix to get around this would be to pass the CDROM or WPIPATH variable to the .cmd file:

WPI config.js

prog[pn]=['Audacity'];
ordr[pn]=[17];
desc[pn]=['Create Music or Change File Extensions'];
uid[pn]=['AUDACITY'];
dflt[pn]=['no'];
cat[pn]=['MultiMedia'];
forc[pn]=['no'];
cmd1[pn]=['%WPIPATH%\\APPS\\Audacity\\Audacity126.exe /SILENT /SP-'];
cmd2[pn]=['%WPIPATH%\\APPS\\Audacity\\Audacity.cmd "%WPIPATH%"'];
pn++;

CMD file

cmdow @ /HID
@Echo Off
MKDIR "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\"
XCOPY /Q "%1\APPS\Audacity\lame_enc.dll" "%SYSTEMDRIVE%\Program Files\Audacity\" /Y
XCOPY /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity.lnk" "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\" /Y
DEL /Q /F "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity.lnk"
DEL /Q /F "%USERPROFILE%\Desktop\Audacity.lnk"

Link to comment
Share on other sites

thanks, zorphnog

but i used to use, and still do if running from CD\DVD

IF EXIST D:\CD.txt set CDROM=D:

IF EXIST E:\CD.txt set CDROM=E:

IF EXIST F:\CD.txt set CDROM=F:

IF EXIST G:\CD.txt set CDROM=G:

IF EXIST H:\CD.txt set CDROM=H:

IF EXIST I:\CD.txt set CDROM=I:

IF EXIST J:\CD.txt set CDROM=J:

XCOPY "%CDROM%\ect. ect.

i have a lot of .cmd files to change, so all i do now is just delete the IF EXIST ect. ect.

then replace the %CDROM% with %localdisk"

i find it a lot quicker this way ...

your way sounds just as good though. and more intrestingly might make the file avalible from a network drive ... hmmm must try this one.

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
  • Recently Browsing   0 members

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