gospeed Posted November 29, 2008 Share Posted November 29, 2008 I know that you can simply insert a shortcut to the systemdrive using the $DOCS\ALL USERS\Desktop\ folder setup, but the shortcut does not accept %CDROM% as a variable drive path. My installs can have various optical drive letters, so I dont want to make the shortcut simply a drive letter. Is there another variable, or another way to accomplish this? Link to comment Share on other sites More sharing options...
gospeed Posted November 30, 2008 Author Share Posted November 30, 2008 Been researching it quite a bit and still havent found any helpful advice. Is it possible that there is no variable for this? Link to comment Share on other sites More sharing options...
floko84 Posted December 7, 2008 Share Posted December 7, 2008 No variables for this as there can be quite a few removable drives in any system.You can however create your own variable in the windows setup scripts, i.e. in a .cmd that is run from cmdlines.txt, add:reg.exe add HKCU\Environment /v CDROM /d %~d0\ /fThis gives you a CDROM variable containing the drive letter of the location of the script, your windows cd - but it won't reflect system changes after setup, so use is very limited.You may use %~d0\ in other steps of your installation, as long as its in a .cmd file. (%~dp0 gives you the complete dir of your script)Flo Link to comment Share on other sites More sharing options...
Yzöwl Posted December 10, 2008 Share Posted December 10, 2008 I've created this packaged script as an executable file which may help you out!Just run it, it doesn't require parameters so it should work equally well unattendedly as on a live system.Run as administator may be necessary in Windows Vista etc.CDdList.zip Link to comment Share on other sites More sharing options...
an3k Posted December 11, 2008 Share Posted December 11, 2008 (edited) Before creating the link, read the value in HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\SourcePath and use it to create your link. This works only if you install windows from CD, installing custom applications from network share doesn't affect this. Edited December 11, 2008 by an3k Link to comment Share on other sites More sharing options...
Yzöwl Posted December 11, 2008 Share Posted December 11, 2008 Just a small update to my previous post.The file will programmatically retrieve the current optical drive(s) and create shortcut(s) on the 'All Users' Desktop to all found.The Shortcut(s) will obviously carry the drive letter as their distinguishing feature:Optical Drive [X]Where X is the assigned drive letterIn order to prevent the possibility of failure before a certain stage of the unattended setup procedure, I have deliberately not used WMI as I've heard reports that it isn't always available during the installation timeline. The executable works on both XP and Vista x86 but has not been tested on x64 systems.To prevent a shortcut installation failure the exe will need to be Run as administrator on a live Vista machine. Link to comment Share on other sites More sharing options...
tain Posted December 11, 2008 Share Posted December 11, 2008 Sweet! You are awesome, Yzowl! 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