MSFN Forum: Windows shortcut's references - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Windows shortcut's references new ways to start Rate Topic: -----

#1 User is offline   nicke85 

  • Chetnik
  • PipPip
  • Group: Members
  • Posts: 110
  • Joined: 13-May 06

Posted 18 September 2006 - 12:35 PM

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)


#2 User is offline   Petr 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 981
  • Joined: 15-April 05
  • OS:98SE
  • Country: Country Flag

Posted 18 September 2006 - 03:24 PM

View Postnicke85, on Sep 18 2006, 08:35 PM, said:

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

#3 User is offline   soporific 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 705
  • Joined: 12-June 05

Posted 18 September 2006 - 11:35 PM

View Postnicke85, on Sep 19 2006, 04:35 AM, said:

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%


#4 User is offline   nicke85 

  • Chetnik
  • PipPip
  • Group: Members
  • Posts: 110
  • Joined: 13-May 06

Posted 19 September 2006 - 09:30 AM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy