Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

CDROM variable

- - - - -

  • Please log in to reply
27 replies to this topic

#26
maxtorix

maxtorix

    Banned

  • Banned
  • 7 posts
  • Joined 03-February 10

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.



But in Windows 7 I get

%%a was unexpected at this time.

What can I do?


How to remove advertisement from MSFN

#27
maxtorix

maxtorix

    Banned

  • Banned
  • 7 posts
  • Joined 03-February 10

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:


In Windows 7 I get:
%%d was unexpected at this time.

#28
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,573 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator


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.



But in Windows 7 I get

%%a was unexpected at this time.

What can I do?


That's because, the double percent should not be used from winnt.sif.
Example
[GuiRunOnce]
	DetachedProgram = CMD.EXE
	Arguments = "/Q /C 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:\<unique> SET CDROM=%a"
The problem however with this approach to the setting of the CDROM variable is that as soon as that command has run, the variable which was local only to that CMD.EXE session only will be removed.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users