Jump to content

How to creat a CD-ROM environment variable


Recommended Posts

i find a post below...but i am not sure about how to use it in a RunOnceEx.cmd file.

http://www.msfn.org/board/index.php?&showtopic=10798&hl=

i tried time and time again..but still didnt work.i used the %CDROM1% variable and installed my apps from a CD,but every time in RunOnceEx setup, an error occured,and the CD drive part of an app's installation path seemed to be blank..

why was that?

Link to comment
Share on other sites


unattended.msfn.org suggests the following for runonceex.cmd (with marker CD.txt on the CD)

IF EXIST D:\CD.txt set CDROM=D:
IF EXIST E:\CD.txt set CDROM=E:
IF EXIST F:\CD.txt set CDROM=F:
IF EXIST G:\CD.txt set CDROM=G:
IF EXIST H:\CD.txt set CDROM=H:
IF EXIST I:\CD.txt set CDROM=I:
IF EXIST J:\CD.txt set CDROM=J:

http://unattended.msfn.org/xp/runonceex_cd.htm

Same results can be achived with

FOR %%d IN (c: 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 %%d\CD.txt SET CDROM=%%d

Link to comment
Share on other sites

I use the following two lines in my runonceex.cmd file. They are two variables I find useful.

SETX CDROM %~d0 -m
SETX DEFAULTUSERPROFILE "%USERPROFILE%" -m

You can get setx off the xp cd, in the support folder. The CDROM one is only useful if you plan on using the xp cd for installations. Otherwise, using the if cdrom, blah blah works.

Link to comment
Share on other sites

I use the following two lines in my runonceex.cmd file.  They are two variables I find useful.

SETX CDROM %~d0 -m
SETX DEFAULTUSERPROFILE "%USERPROFILE%" -m

You can get setx off the xp cd, in the support folder.  The CDROM one is only useful if you plan on using the xp cd for installations.  Otherwise, using the if cdrom, blah blah works.

i cant find it in the xp cd suport folder.is it a tool or just an instrution?

Link to comment
Share on other sites

SETX CDROM %~d0 -m

it does not seem to work...what does the %~d0 stand for?

i use a DVD rom..so how to configure the variable to match my own CDROM?

It has to run in a cmd file and on the CD/DVD. I put this command in my runonceex.cmd file, which i call with command lines. You can put it in another cmd file if you wish, but it has to be on the cd.

%~d0 is a variable. It says give me the drive of the first arguement, which is the script.

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...