Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CDROM variable

Featured Replies

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

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

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

keep goin 2 the end of the alphabet :P

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

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.

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

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

(Sorry for being a few seconds faster lol)

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

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.

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.

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

  • 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

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

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

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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.