LazyBoy Posted March 23, 2006 Share Posted March 23, 2006 (edited) I just finished reading the "RunOnceEX from CD" and there is something not so clear that I didn't get.**********************************Alternatively, you can use the following code to set the %CDROM% variable if you wish to not be bothered by the CD.txt file requirements, or the inefficiency of checking every drive for a specific file, used of the previous method.SetLocal enableextensionsSET CDROM=%~d0It works by setting the %CDROM% variable to the same drive on which the script resides. In this case, the script being the actual RunOnceEx.cmd file. Just make sure you also includeEndLocalbefore the EXIT line, to close the extension. Keep in mind, when the extension is closed, the %CDROM% variable will be reset. For consistency, this guide will use the first method, but both are working solutions.**********************************Where do I put the SetLocal enableextensions? Is this the correct way?cmdow @ /HID@Echo OffFOR %%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:\CD.txt SET CDROM=%%i:SetLocal enableextensionsSET CDROM=%~d0SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Programs" /fREG ADD %KEY%\005 /VE /D "Adobe Acrobat 7.0.5" /fREG ADD %KEY%\005 /V 1 /D "%CDROM%\switchless\reader705.exe" /fREG ADD %KEY%\010 /VE /D "Microsoft .NET Framework 2.0" /fREG ADD %KEY%\010 /V 1 /D "%CDROM%\switchless\dotnet2.exe" /fEndLocalEXITIs this correct? Thanks in advance for any help. Edited March 23, 2006 by LazyBoy Link to comment Share on other sites More sharing options...
Yzöwl Posted March 23, 2006 Share Posted March 23, 2006 It says alternatively, therefore eithercmdow @ /HID@Echo OffFOR %%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:\CD.txt SET CDROM=%%i:orSetLocal enableextensionsSET CDROM=%~d0However, the first example is still badly advised, but that is a matter for the unattended guide and not really of concern to yourself. Link to comment Share on other sites More sharing options...
LazyBoy Posted March 23, 2006 Author Share Posted March 23, 2006 Can I use cmdow @ /HID with the alternate method? Likecmdow @ /HIDSetLocal enableextensionsSET CDROM=%~d0SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Programs" /fREG ADD %KEY%\005 /VE /D "Adobe Acrobat 7.0.5" /fREG ADD %KEY%\005 /V 1 /D "%CDROM%\switchless\reader705.exe" /fREG ADD %KEY%\010 /VE /D "Microsoft .NET Framework 2.0" /fREG ADD %KEY%\010 /V 1 /D "%CDROM%\switchless\dotnet2.exe" /fEndLocalEXITI haven't seen how RunOnceEx from CD works out but is cmdow needed? Link to comment Share on other sites More sharing options...
Yzöwl Posted March 23, 2006 Share Posted March 23, 2006 Can I use cmdow @ /HID with the alternate method? Likecmdow @ /HIDSetLocal enableextensionsSET CDROM=%~d0<snip>Yes, all CMDOW is doing in this case is hiding the cmd window. Since there is no need to turn echoing off, the only thing required in your example is to alter the first line to prevent that being echoed too@cmdow @ /hid 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