leungda Posted October 18, 2004 Share Posted October 18, 2004 I just want to know the CDROM variable for WinXP unattended on RunOnceEx.cmdIs 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 More sharing options...
MCT Posted October 18, 2004 Share Posted October 18, 2004 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: Link to comment Share on other sites More sharing options...
leungda Posted October 18, 2004 Author Share Posted October 18, 2004 thanks for your help... Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 18, 2004 Share Posted October 18, 2004 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 More sharing options...
SiMoNsAyS Posted October 18, 2004 Share Posted October 18, 2004 (edited) 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 October 18, 2004 by SiMoNsAyS Link to comment Share on other sites More sharing options...
CoffeeFiend Posted October 18, 2004 Share Posted October 18, 2004 Same thing than I do, just with more : 's (oh, and %%d verus %%a) Works nicely (Sorry for being a few seconds faster lol) Link to comment Share on other sites More sharing options...
drixomanbeta Posted January 23, 2012 Share Posted January 23, 2012 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=%%aI 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 More sharing options...
Yzöwl Posted January 23, 2012 Share Posted January 23, 2012 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 More sharing options...
drixomanbeta Posted January 28, 2012 Share Posted January 28, 2012 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. Link to comment Share on other sites More sharing options...
Yzöwl Posted January 29, 2012 Share Posted January 29, 2012 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 More sharing options...
drixomanbeta Posted February 6, 2012 Share Posted February 6, 2012 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.cmdThe 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 /parameterBoth 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 More sharing options...
Yzöwl Posted February 7, 2012 Share Posted February 7, 2012 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 More sharing options...
drixomanbeta Posted February 8, 2012 Share Posted February 8, 2012 (edited) I skipped the Systemdrive part, was that required?---G:---$OEM$VALUEADDUPDATEDOCSI386SUPPORTcmpnentsPostInstall.cmdLast Session_u.iniSETUP.EXELast Session.iniBOOTFONT.BINAUTORUN.INFWIN51WIN51IPREADME.HTMsetupxp.htmwin51ip.SP2win51ip.SP3Sorry 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 February 8, 2012 by drixomanbeta Link to comment Share on other sites More sharing options...
Yzöwl Posted February 8, 2012 Share Posted February 8, 2012 Now the exact contents, (no editing), of your PostInstall.cmd. Link to comment Share on other sites More sharing options...
drixomanbeta Posted February 9, 2012 Share Posted February 9, 2012 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now