CDROM variable
#1
Posted 17 October 2004 - 08:25 PM
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" ???
#2
Posted 17 October 2004 - 08:51 PM
IF EXIST D:\somefile.whatever set CDROM=D:
keep goin 2 the end of the alphabet
IF EXIST Z:\somefile.whatever set CDROM=Z:
#4
Posted 17 October 2004 - 09:15 PM
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.
#5
Posted 17 October 2004 - 09:16 PM
Quote
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
This post has been edited by SiMoNsAyS: 18 October 2004 - 08:05 AM
#6
Posted 18 October 2004 - 12:05 AM
(Sorry for being a few seconds faster lol)
#7
Posted 22 January 2012 - 08:55 PM
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.
#8
Posted 23 January 2012 - 10:58 AM
#9
Posted 28 January 2012 - 02:54 PM
#10
Posted 29 January 2012 - 07:45 AM
[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
#11
Posted 06 February 2012 - 03:10 PM
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
#12
Posted 07 February 2012 - 02:20 PM
for %# in (%systemdrive% X:) do @(echo/---%#---&dir/b/a/og %#)Replace X with the drive letter for your inserted unattended media
#13
Posted 07 February 2012 - 08:45 PM
---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.
This post has been edited by drixomanbeta: 07 February 2012 - 08:53 PM
#14
Posted 07 February 2012 - 11:34 PM
#15
Posted 08 February 2012 - 08:06 PM
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
#16
Posted 09 February 2012 - 12:40 PM
@ECHO OFF TITLE Testing Script ECHO=%%CDROM%%=%~d0 ECHO=Delaying tactics employed PING -n 11 127.0.0.1 1>NUL
BTW, which part of exact contents and no editing did you not understand?
#17
Posted 09 February 2012 - 02:31 PM
Do you want me to change the batch to what you provided there and call it with the Run dialog with the parameter you provided earlier?
#18
Posted 09 February 2012 - 03:57 PM
FOR /F %# IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO IF EXIST %#PostInstall.cmd CALL %#PostInstall.cmd
recreate the original set-up, replacing only the content of the batch file. This should isolate the problem area to either your batch file or the implementation of the set-up.
#19
Posted 09 February 2012 - 10:45 PM
Yzöwl, on 09 February 2012 - 03:57 PM, said:
FOR /F %# IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO IF EXIST %#PostInstall.cmd CALL %#PostInstall.cmd
recreate the original set-up, replacing only the content of the batch file. This should isolate the problem area to either your batch file or the implementation of the set-up.
okay...I replaced my batch with your ping test and ran the for loop from a prompt. Here's what happens:
D:\Documents and Settings\Drix>IF EXIST C:\PostInstall.cmd CALL C:\PostInstall.c md D:\Documents and Settings\Drix>IF EXIST D:\PostInstall.cmd CALL D:\PostInstall.c md D:\Documents and Settings\Drix>IF EXIST E:\PostInstall.cmd CALL E:\PostInstall.c md D:\Documents and Settings\Drix>IF EXIST G:\PostInstall.cmd CALL G:\PostInstall.c md %CDROM%=G: Delaying tactics employed
From there it just exit and return to the prompt. My (virtual) disc drive is G: (Daemon Tools Lite)
Just my opinion but I don't think there's anything wrong with my batch file, seeing that it works no problem if it's just dbl-clicked on (even as burned to CD, so it's probably not related to batch and the set-up's file structure).
#20
Posted 10 February 2012 - 03:17 AM
Since the folder structure you provided contains the tag file required I can see only two likely problems, your winnt.sif or your PostInstall.cmd. If you are convinced that your batch script, (the content of which you have hidden from us), is okay then your issue is with the .sif file. However since you reported the script not running from my command earlier, and your folder structure clearly shows it should with a working command line, I am not ruling out the script as the most likely problem.
In order to find a solution, attach both files exactly as they are to be examined, otherwise you are on your own.
- ← [URGENT] webcam not recognized at all!
- Unattended Windows 2000/XP/2003
- Creating unattended installation witout original Win CD →



Help

Back to top









