Followers 0

# CDROM variable

## 28 posts in this topic

I just want to know the CDROM variable for WinXP unattended on RunOnceEx.cmd

Is it - > %CDROM% or %CDDRIVE% ????

If I have one or more CDROM or partition, Is the system find the CDROM "with installation CD" automatically?

If not , how can I let the system know where is the CDROM "with installation CD in it" ???

0

##### Share on other sites

IF EXIST C:\somefile.whatever set CDROM=C:

IF EXIST D:\somefile.whatever set CDROM=D:

keep goin 2 the end of the alphabet

IF EXIST Z:\somefile.whatever set CDROM=Z:

0

##### Share on other sites

thanks for your help...

0

##### Share on other sites

Why everybody seems to insist on doing it this way is beyond me (almost all post about their CDRom var seem to be like that anyways)

for %%a 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 %%a:\path\to\file.xyz set CDROM=%%a:

Works for all letters. One clean command line.

0

##### Share on other sites

i personally use

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
what it's marked in red can be changed to any singular file that you would like to use.

what it's marked in green can be changed to call the cdrom like %CDROM% or %ANYSTRING%. hope it hleps

edit: f***! another time some1 is faster

Edited by SiMoNsAyS
0

##### Share on other sites

Same thing than I do, just with more : 's (oh, and %%d verus %%a) Works nicely

(Sorry for being a few seconds faster lol)

0

##### Share on other sites

Hi,

before I say anything, yes I know this seem to have been asked multiple time but bear with me. I'm a definite newb at this...

anyway...I've found this little code that I think would satisfy navigating to the installation source directory with the GUIRunOnce in winnt.sif (I have no doubt this look very familiar to you experts on here)

for %%a 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 %%a:\yourfile.xyz set CDROM=%%a

I thought, why couldn't I just call cmd.exe from GUIRunOnce, passing the above statement (which would normally be ran in a separate batch file) as a parameter (or "echo" it into the prompt and ran, if that's pretty much the same thing...) instead of putting that in a separate file having to be copied from $OEM$ folder.

Any idea how to do this? I must admit I have NO skill with the command prompt at all that can be even close to help here....

Thanks.

0

##### Share on other sites

SET will not set a variable beyond the current session so you cannot simply set a variable which can be used in future command sessions. Each line you create under GUIRunOnce will be a different command session. If you wish to work directly from GUIRunOnce, you'd have to do it all in one single line of commands concatenated as required.

0

##### Share on other sites

Well...I was just thinking to use it to call on one batch file only on my disc. I'm not planning to run all my command with just one long concatenate by calling on cmd at RunOnce.

0

##### Share on other sites

If you create a directory, SCRIPTS, in for instance, YourCD:\SUPPORT\TOOLS you can place MyScript.cmd inside it and run something like this from winnt.sif:

[GuiRunOnce]	DetachedProgram = CMD.EXE	Arguments = "/Q /C FOR /F %# IN ('%SYSTEMROOT%\SYSTEM32\MOUNTVOL.EXE^|FINDSTR [C-Z]:\\') DO IF EXIST %#WIN51 CALL %#SUPPORT\TOOLS\SCRIPTS\MyScript.cmd"

The above is three lines in total.

That should run the script from your CDROM meaning that all commands within that script can be designed to be local to the CDROM e.g. %~d0

0

##### Share on other sites

Hi, sorry for being a little late...

I tried your code above but it doesn't seem to be able to find the file that my batch file is suppose to start.

I first tried it in installation, then I just tried it in plain Windows with a Run dialog with the following

%SYSTEMROOT%\SYSTEM32\cmd.exe /Q /C FOR /F %# IN ('%SYSTEMROOT%\SYSTEM32\MOUNTVOL.EXE^|FINDSTR [C-Z]:\\') DO IF EXIST %#WIN51 CALL %#PostInstall.cmd

The master batch PostInstall is at the root of CD, and it's suppose to "START /wait" a couple of program:

the line in the batch program is : Start /wait UPDATE\3whateverprogram\whateverprogram.exe /parameter

Both pretty much give the same result of not finding what the Start command is suppose to find. Simply running the batch file from the cd's root has no such problem.

Any idea how to fix this?

Thanks

0

##### Share on other sites

Can you provide a directory listing? Type the following into a command prompt and copy/paste the output into your response.

for %# in (%systemdrive% X:) do @(echo/---%#---&dir/b/a/og %#)

Replace X with the drive letter for your inserted unattended media

0

##### Share on other sites

I skipped the Systemdrive part, was that required?

---G:---$OEM$VALUEADDUPDATEDOCSI386SUPPORTcmpnentsPostInstall.cmdLast Session_u.iniSETUP.EXELast Session.iniBOOTFONT.BINAUTORUN.INFWIN51WIN51IPREADME.HTMsetupxp.htmwin51ip.SP2win51ip.SP3

Sorry for some editing there, I moved my batch file into a folder later on but still the same problem. I now moved it back.

Edited by drixomanbeta
0

##### Share on other sites

Now the exact contents, (no editing), of your PostInstall.cmd.

0

##### Share on other sites

Here's the batch file:

CLS@echo offTITLE Post InstallECHO Installing KBECHO Please Wait...start /wait UPDATE\977816\update\update.exe /norestart /passive /nobackupstart /wait UPDATE\n2656353.msp  /norestart /passive (there's other stuff in the same format as above here)EXIT

0

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