beppemito Posted September 21, 2004 Share Posted September 21, 2004 how can i use this command cdrom=WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup\\SourcePath")in a file.cmd to using this:xcopy cdrom\directory\file.exe %systemdrive%\patch\? Link to comment Share on other sites More sharing options...
jdoe Posted September 21, 2004 Share Posted September 21, 2004 I would do something like thisFOR /F "tokens=1,2,3 skip=4" %%I IN ('REG.EXE QUERY "HKLM\Software\Microsoft\Windows\CurrentVersion\Setup" /v SourcePath') DO SET CDROM=%%KXCOPY %CDROM%directory\file.exe %systemdrive%\patch\Hope this will help you Link to comment Share on other sites More sharing options...
sleepnmojo Posted September 21, 2004 Share Posted September 21, 2004 Doing a search on CDROM variable would probably turn up several threads on different ways to get it. Link to comment Share on other sites More sharing options...
jdoe Posted September 21, 2004 Share Posted September 21, 2004 Sure there is many ways to get %CDROM% and I think this one is the best for 1 reason... it doesn't require CD.TXT or something not include on XP CDand I don't understand why this line is not on "http://unattended.msfn.org/xp/runonceex_cd.htm" instead ofIF EXIST D:\CD.txt set CDROM=D:IF EXIST E:\CD.txt set CDROM=E:......%CDROM%FOR /F "tokens=3" %%I IN ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v SourcePath ^| FIND "SourcePath"') DO SET CDROM=%%~dI Link to comment Share on other sites More sharing options...
jondercik Posted September 21, 2004 Share Posted September 21, 2004 Why not jsut use WSH to copy the files since you are already using that language? Link to comment Share on other sites More sharing options...
beppemito Posted September 21, 2004 Author Share Posted September 21, 2004 what's the difference betwen FOR /F "tokens=3" %%I IN ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v SourcePath ^| FIND "SourcePath"') DO SET CDROM=%%~dI and FOR /F "tokens=1,2,3 skip=4" %%I IN ('REG.EXE QUERY "HKLM\Software\Microsoft\Windows\CurrentVersion\Setup" /v SourcePath') DO SET CDROM=%%KXCOPY %CDROM%directory\file.exe %systemdrive%\patch\??? Link to comment Share on other sites More sharing options...
jdoe Posted September 22, 2004 Share Posted September 22, 2004 @beppemitoI've wrote this one from memory just to give you something to work with%CDROM% = D:\FOR /F "tokens=1,2,3 skip=4" %%I IN ('REG.EXE QUERY "HKLM\Software\Microsoft\Windows\CurrentVersion\Setup" /v SourcePath') DO SET CDROM=%%KThis is the good one (drive used for Windows installation)%CDROM% = D:FOR /F "tokens=3" %%I IN ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v SourcePath ^| FIND "SourcePath"') DO SET CDROM=%%~dI Link to comment Share on other sites More sharing options...
beppemito Posted September 22, 2004 Author Share Posted September 22, 2004 thanks 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