amd64 Posted February 10, 2007 Share Posted February 10, 2007 (edited) Hi all,i tend to install all my applications after (unattended) windows has loaded to the desktopfor 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 WPIso what i have done is to use the %LocalDisk% variablehere 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.cmdcmdow @ /HID@Echo OffMKDIR "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\"XCOPY /Q "%LocalDisk%\WPI\APPS\Audacity\lame_enc.dll" "%SYSTEMDRIVE%\Program Files\Audacity\" /YXCOPY /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity.lnk" "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\" /YDEL /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\" /Yyou 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 driveif this has been discused before accept my apologys, if not then someone might find it usefullregards, amd64 Edited February 10, 2007 by amd64 Link to comment Share on other sites More sharing options...
zorphnog Posted February 12, 2007 Share Posted February 12, 2007 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.jsprog[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 filecmdow @ /HID@Echo OffMKDIR "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\"XCOPY /Q "%1\APPS\Audacity\lame_enc.dll" "%SYSTEMDRIVE%\Program Files\Audacity\" /YXCOPY /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity.lnk" "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity\" /YDEL /Q /F "%ALLUSERSPROFILE%\Start Menu\Programs\Audacity.lnk"DEL /Q /F "%USERPROFILE%\Desktop\Audacity.lnk" Link to comment Share on other sites More sharing options...
amd64 Posted February 12, 2007 Author Share Posted February 12, 2007 thanks, zorphnogbut i used to use, and still do if running from CD\DVDIF 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 More sharing options...
zorphnog Posted February 13, 2007 Share Posted February 13, 2007 (edited) Oh, I didn't know you were refering to a custom CDROM variable.Your way works fine, I just prefer to use my way because it is more dynamic (will work for CD/DVD, USB, network, etc...). Edited February 13, 2007 by zorphnog Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now