MSFN Forum: A mega easy to get the CDROM variable set - MSFN Forum

Jump to content



  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

A mega easy to get the CDROM variable set Rate Topic: -----

#21 User is offline   evilvoice 

  • Ditchy McAbandonpants
  • PipPipPipPipPip
  • Group: Members
  • Posts: 946
  • Joined: 27-January 04

Posted 19 July 2004 - 10:58 PM

you say rip off, i say whatever...use yours, but it was pointed out as to certain times when yours would not work...but whatever...

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 User is offline   GreenMachine 

  • ineXPlicable
  • Group: Developers
  • Posts: 3,062
  • Joined: 22-August 03

Posted 20 July 2004 - 11:12 AM

Can I play, too?
FOR /F "TOKENS=3" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" ^| FINDSTR "SourcePath"') DO SET INSTALLCD=%%~dI


#23 User is offline   bookie 

  • Group: Members
  • Posts: 5
  • Joined: 05-August 04

Posted 06 August 2004 - 10:46 AM

Thanx for this hint.

Any idea, how you can achieve this with 98 ??

thx

Markus

#24 User is offline   cyberdiamond 

  • Member
  • PipPip
  • Group: Members
  • Posts: 115
  • Joined: 28-July 03

Posted 06 August 2004 - 09:55 PM

zippy, on Jul 19 2004, 08:21 PM, said:

I'm glad that so many people find this useful. I use it a lot after cyberdiamond told how/why a month ago.

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 User is offline   expert01 

  • Junior
  • Pip
  • Group: Members
  • Posts: 62
  • Joined: 01-December 03

Posted 07 August 2004 - 02:52 AM

Would there be a way to search for \i386\winnt.exe on all drives (until it's found) and use that drive as the CD drive?

#26 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 07 August 2004 - 08:54 AM

expert01, on Aug 7 2004, 11:52 AM, said:

Would there be a way to search for \i386\winnt.exe on all drives (until it's found) and use that drive as the CD drive?

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 User is offline   DarkPhoenix 

  • Codename: Kirby
  • PipPip
  • Group: Members
  • Posts: 201
  • Joined: 30-May 04

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:

Would there be a way to search for \i386\winnt.exe on all drives (until it's found) and use that drive as the CD drive?

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 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 07 August 2004 - 02:16 PM

DarkPhoenix, on Aug 7 2004, 09:08 PM, said:

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

Alright Sir! NP! :)

#29 User is offline   CoffeeFiend 

  • Coffee Aficionado
  • Group: Super Moderator
  • Posts: 5,260
  • Joined: 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 08 August 2004 - 07:00 PM

Yes, it work in any scenario, but just a note, I did an error while copy/pasting. It should have been:

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 User is offline   OCedHrt 

  • Newbie
  • Group: Members
  • Posts: 41
  • Joined: 08-August 04

Posted 08 August 2004 - 07:13 PM

I'll join too :D Finally got this working.

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 :rolleyes: Thanks to zippy's post in another thread that helped me finally figure out how to get batch files to work 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.

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy