nicke85 Posted September 18, 2006 Posted September 18, 2006 Excuse me if this topic was allready opened!I need to make a few desktop shorcuts to run allways certain programs from my first cdrom device.So in *.bat files we can use some universal codes like%WINDIR% - for Windows folder%cdrom% - boot cd rom device%RAMD% - for first located RAM driveAnd now I want to know how to make shortcut which run always from my first cd rom device.Examle to be doesn't matter if I have one HDD patition or a thousand else...the result of running shortcut will be always some program from my first cd-rom device orfrom other cd-rom device where is my certain program.I think that uni code for such shortcut is something like %cdrom%\folder1\folder2\program.exeIf somebody know that please to help!ps. (The better way is to find automatic only drive leter if necessary... but yet if it possible)
Petr Posted September 18, 2006 Posted September 18, 2006 Excuse me if this topic was allready opened!I need to make a few desktop shorcuts to run allways certain programs from my first cdrom device.So in *.bat files we can use some universal codes like%WINDIR% - for Windows folder%cdrom% - boot cd rom device%RAMD% - for first located RAM driveYou can use everything displayed by SET command, %cdrom% are %RAMD% are not standard.Petr
soporific Posted September 19, 2006 Posted September 19, 2006 And now I want to know how to make shortcut which run always from my first cd rom device.I don't know of a way to always find the first CD-ROM without using the contents of a particular CD. If you do know what CD you will be using, it is very easy:1) On your CD, create a unique file for you code to find - ie i use setuptip.txt in my example.2) And then use this code to set the CDROM letter:FindCDRMrem|choice>NUL /c:c /n /t:c,1IF EXIST D:\setuptip.txt set CDROM=D:if %cdrom%!==D:! goto FindWindIF EXIST E:\setuptip.txt set CDROM=E:if %cdrom%!==E:! goto FindWindIF EXIST F:\setuptip.txt set CDROM=F:if %cdrom%!==F:! goto FindWindIF EXIST G:\setuptip.txt set CDROM=G:if %cdrom%!==G:! goto FindWindIF EXIST H:\setuptip.txt set CDROM=H:if %cdrom%!==H:! goto FindWindIF EXIST I:\setuptip.txt set CDROM=I:if %cdrom%!==I:! goto FindWindIF EXIST J:\setuptip.txt set CDROM=J:if %cdrom%!==J:! goto FindWindIF EXIST K:\setuptip.txt set CDROM=K:if %cdrom%!==K:! goto FindWindif %cdrom%!==! for %%Z in ("echo Please insert CD..." goto:FINDCDRM) do %%ZINCIDENTLY, i have always been peed off that Windows 98 does not have a standard variable for the windows installation drive letter. (ie %systemdrive% in WinXP does not exist for Win98). Finally I have figured out a way to set one, although you need to use a special .com file to do it. NSET.com can be downloaded from hereThis is the code to set your own custom systemdrive variable in Win98: (put NSET.com into the Windows directory):FindWindSET windrive=NoneFound:: Need to use a unique directory, code resets Unique value if directory already exists.SET Unique=%windir%\sylsyl.traIF EXIST "%windir%\sylsyl.tra" SET Unique=%windir%\sylsyl1.tra:: Send the Windows installation directory to a text fileecho %windir% > "%Unique%":: Use NSET to read the first character from the file%windir%\NSET /P1,1 TVar=$1 < "%Unique%":: Set the drive letterSET windrive=%Tvar%::: Clean up afterwardsDEL "%Unique%" >nulSET Unique=:: Report the driveEcho. Windows 98 is installed on the %windrive% drive in %windir%
nicke85 Posted September 19, 2006 Author Posted September 19, 2006 Cool!!!I're maked bat files from your code.It works perfect soporific,thanx a lot! The second one is the best,i can live with it to use .bat files on my desktop.But now I'm amusing to put similar code into windows *.lnk (Win shortcut file)do u maybe know something about it!?
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