Jump to content

CDROM variable


Recommended Posts

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

Link to comment
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.

Link to comment
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 :lol:

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

Edited by SiMoNsAyS
Link to comment
Share on other sites

  • 7 years later...

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.

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
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

Link to comment
Share on other sites

I skipped the Systemdrive part, was that required?


---G:---
$OEM$
VALUEADD
UPDATE
DOCS
I386
SUPPORT
cmpnents
PostInstall.cmd
Last Session_u.ini
SETUP.EXE
Last Session.ini
BOOTFONT.BIN
AUTORUN.INF
WIN51
WIN51IP
README.HTM
setupxp.htm
win51ip.SP2
win51ip.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
Link to comment
Share on other sites

Here's the batch file:


CLS
@echo off
TITLE Post Install

ECHO Installing KB
ECHO Please Wait...

start /wait UPDATE\977816\update\update.exe /norestart /passive /nobackup
start /wait UPDATE\n2656353.msp /norestart /passive
(there's other stuff in the same format as above here)

EXIT

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