Jump to content

Windows shortcut's references


nicke85

Recommended Posts

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 drive

And 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 or

from other cd-rom device where is my certain program.

I think that uni code for such shortcut is something like

%cdrom%\folder1\folder2\program.exe

If somebody know that please to help!

ps. (The better way is to find automatic only drive leter if necessary...

but yet if it possible)

Link to comment
Share on other sites


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 drive

You can use everything displayed by SET command, %cdrom% are %RAMD% are not standard.

Petr

Link to comment
Share on other sites

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


:FindCDRM
rem|choice>NUL /c:c /n /t:c,1
IF EXIST D:\setuptip.txt set CDROM=D:
if %cdrom%!==D:! goto FindWind
IF EXIST E:\setuptip.txt set CDROM=E:
if %cdrom%!==E:! goto FindWind
IF EXIST F:\setuptip.txt set CDROM=F:
if %cdrom%!==F:! goto FindWind
IF EXIST G:\setuptip.txt set CDROM=G:
if %cdrom%!==G:! goto FindWind
IF EXIST H:\setuptip.txt set CDROM=H:
if %cdrom%!==H:! goto FindWind
IF EXIST I:\setuptip.txt set CDROM=I:
if %cdrom%!==I:! goto FindWind
IF EXIST J:\setuptip.txt set CDROM=J:
if %cdrom%!==J:! goto FindWind
IF EXIST K:\setuptip.txt set CDROM=K:
if %cdrom%!==K:! goto FindWind
if %cdrom%!==! for %%Z in ("echo Please insert CD..." goto:FINDCDRM) do %%Z

INCIDENTLY, 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 here

This is the code to set your own custom systemdrive variable in Win98: (put NSET.com into the Windows directory)

:FindWind
SET windrive=NoneFound

:: Need to use a unique directory, code resets Unique value if directory already exists.
SET Unique=%windir%\sylsyl.tra
IF EXIST "%windir%\sylsyl.tra" SET Unique=%windir%\sylsyl1.tra

:: Send the Windows installation directory to a text file
echo %windir% > "%Unique%"

:: Use NSET to read the first character from the file
%windir%\NSET /P1,1 TVar=$1 < "%Unique%"

:: Set the drive letter
SET windrive=%Tvar%:

:: Clean up afterwards
DEL "%Unique%" >nul
SET Unique=

:: Report the drive
Echo. Windows 98 is installed on the %windrive% drive in %windir%

Link to comment
Share on other sites

Cool!!!

I're maked bat files from your code.

It works perfect soporific,thanx a lot! :lol::lol::lol:

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!?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...