A mega easy to get the CDROM variable set
#21
Posted 19 July 2004 - 10:58 PM
PS i think a rip off has to do with me stealing something...as I listed the site, I dont think that constitutes stealing...I just posted what i had because if you have 2-3 cdrom drives, as I do, then youll need to make some changes so it only finds the first one...
If you think I stole your idea...try again...I can even show you how long ago I found out how to do this...but believe what you want
If you didnt mean to come off as an a**, you should choose your wording better.
#22
Posted 20 July 2004 - 11:12 AM
FOR /F "TOKENS=3" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" ^| FINDSTR "SourcePath"') DO SET INSTALLCD=%%~dI
#23
Posted 06 August 2004 - 10:46 AM
Any idea, how you can achieve this with 98 ??
thx
Markus
#24
Posted 06 August 2004 - 09:55 PM
zippy, on Jul 19 2004, 08:21 PM, said:
Glad I could help
As many have realised there are a lot of different ways to get the same result.
Use whatever your comfortable with or whatever you understand best.
I always use what I can understand as come trouble shooting time (it will happen) you will know whats going on and will be better able to pinpoint the problem!
#25
Posted 07 August 2004 - 02:52 AM
#26
Posted 07 August 2004 - 08:54 AM
expert01, on Aug 7 2004, 11:52 AM, said:
In this case, you need the classical method:
if exist D:\i386\winnt.exe set CDROM=D:
.
.
if exist Z:\i386\winnt.exe set CDROM=Z:
#27
Posted 07 August 2004 - 12:08 PM
mazin, on Aug 7 2004, 04:54 PM, said:
expert01, on Aug 7 2004, 11:52 AM, said:
In this case, you need the classical method:
if exist D:\i386\winnt.exe set CDROM=D:
.
.
if exist Z:\i386\winnt.exe set CDROM=Z:
Nah, crahak's idea is better:
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:\i386\winnt.exe set CDROM=%%a
#28
Posted 07 August 2004 - 02:16 PM
DarkPhoenix, on Aug 7 2004, 09:08 PM, said:
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:\i386\winnt.exe set CDROM=%%a
Alright Sir! NP!
#29
Posted 08 August 2004 - 07:00 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:\i386\winnt.exe set CDROM=%%a:
(With a : at the end)
That way your CDRom letter is say, J: istead of J ... You get the idea anyways. If you don't want to search thru all these drives, just remove the ones you don't want but eithe way it's pretty quick and never fails me. You could make it look for win51ip.SP2 or winnt.sif or whatever too...
I use that to launch my main installing script from a a directory full of installers (not located in $OEM$ at all). I just don't see a point of copying the installers to the HD first during the setup phase like lots of guys seem to do. Also, I much rather have one big script that launches the installers, adds registry entries, and launches more "sub"-scripts to tweak the installation instead of other methods. Some people seem too see GUIRunOnce as a n00b method, I just see it as more versatile and better adapted for my needs...
#30
Posted 08 August 2004 - 07:13 PM
FOR /F "skip=2 delims=\ usebackq" %I IN (`FIND "dospath" %SystemRoot%\SYSTEM32\$WINNT$.INF`) DO SET %I
The above sets the env variable dospath to the installation drive.
Here %I is the entire dospath=cddrive: which is convenient for set
What I use in my batch file is:
FOR /F "eol=\ skip=2 delims=\= tokens=2 usebackq" %%I IN (`FIND "%1" %SystemRoot%\SYSTEM32\$WINNT$.INF`) DO %%I\$OEM$\Files\$OEM$.exe -y /q /r:n -o"%SystemRoot%\Driver Cache"
This one only returns "letter:" for %I
And the great thing is, this runs at T-39
Batches files have to be started with cmd.exe with the swiches /C START filename.bat. I used %1 for the find to pass as an argument, but I doubt that does anything special.
I haven't tried with cmd so don't know if that works. /C START is very important. just cmd.exe /C filename.bat may work in a command prompt but it doesn't work during setup.
Also, from my experiences the batch file is necessary. I've been trying to do it without any intermediate files at all for 12+ hours straight :/ The arguments assignment in winnt.sif won't take more than 1 set of quotes so FIND can't be used there. If anyone figures this out please let me know.
- ← XP SP2 updates integration
- Unattended Windows 2000/XP/2003
- unattend-issues with F6 during install →



Help


Back to top









