MSFN Forum: CDROM variable - MSFN Forum

Jump to content


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

CDROM variable Rate Topic: -----

#21 User is offline   drixomanbeta 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 24-May 10
  • OS:XP Pro x86
  • Country: Country Flag

Posted 10 February 2012 - 05:25 PM

I have posted my batch file earlier, could you not see it?

I'm pretty sure my batch (should) have no problem, seeing that if you just run it normally from explorer all the start commands works, as the target program are all called as relative path.

It's just that when it is called by your parameter it seems to have lost track of its "starting location" or something. I wouldn't think we need to examine the sif file as even not in installation mode I'm unable to get my batch to perform as it should with your command there, so it's doubtful that it's an installation issue.
But here's the two file you requested: I changed the sif to have it run at T-9 instead of GuiRunOnce, but that shouldn't matter since the same problem of my batch not finding directory structure correctly persist. The problem it seems is rather fundamental and I'm not expecting it to change with different timing of the call to the batch.

Attached File(s)




#22 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,363
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 11 February 2012 - 11:03 AM

I gave you the entries for GuiRunOnce as requested but you decided to go it alone, so you have your wish!

#23 User is offline   bphlpt 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,075
  • Joined: 12-May 07

Posted 11 February 2012 - 04:20 PM

@drixomanbeta -

I counted at least five times in this thread where Yzöwl asked you to do or report something specific, and you decided to do or report something different, always saying "but that shouldn't matter...". Yzöwl has decided, since you obviously feel you know what should or shouldn't be done, that you must not need any help, and I think everyone else here agrees with him. We will be curious to learn what you eventually find to be the problem Who knows? We might learn something.

In the future, if you ask someone to help, and they graciously offer to give you advice, here or elsewhere:

First - Take it. Do not edit it, do not change it, do not question it, do not try a shortcut, do not ask why, do not think, just do it and report exactly what happened. There are usually good reasons why you are being asked to do or report something specific.

Then - Propose alternatives, ask questions, show what happens when you do it a different way. In the exchange of data, in both directions, we can both learn something. But if you won't listen to us, then why should we listen to you?

Please let us know when you find a solution.

Cheers and Regards

#24 User is offline   drixomanbeta 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 24-May 10
  • OS:XP Pro x86
  • Country: Country Flag

Posted 19 February 2012 - 01:13 AM

In fact I did found the problem, and the solution. You wouldn't (would you?) believe how simple it was...(and how dumb I was.) :blink:

The problem: in my batch file I kept relative path when I should have used full, like so: start /wait %~d0\UPDATE\... Problem solved.

Apparently it did not occur to the unenlightened me of what y'all here would probably have thought of as 1+1

Then again, when I said I was a newb, I really did meant it. How come this batch worked when ran on its own while called on by prompt it fails? Anyway...

To that end...I still don't understand how %~d0 actually work (yes I searched for it...something about %n special enviro variable...way out of my league to comprehend :( )

Anyway, thanks for the help here; consider my question answered. At least if some other simpleton like me asked these silly type of question...well they won't have to torment you experts for too much with this particular case. (I probably should have sticked to svcpack rather than setupparams. I obviously don't know the difference (except I know I have some other stuff from addonpacks being called at T-13; don't want to mess up that). :hello:

"I'm a simple man. I do not possess a [compsci] degree nor am I [algorithmically] inclined." ~George Carlin. :blushing:

#25 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,363
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 19 February 2012 - 06:09 AM

View Postdrixomanbeta, on 19 February 2012 - 01:13 AM, said:

In fact I did found the problem, and the solution. You wouldn't (would you?) believe how simple it was...(and how dumb I was.) :blink:

The problem: in my batch file I kept relative path when I should have used full, like so: start /wait %~d0\UPDATE\... Problem solved.

I had already told you to do that too! :whistle:

View PostYzöwl, on 29 January 2012 - 07:45 AM, said:

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


Thanks for posting back and for providing closure to the problem, it means that other readers with the same or similar problem can use the advice given in the knowledge that it is known to work!

#26 User is offline   maxtorix 

  • Group: Members
  • Posts: 7
  • Joined: 03-February 10

Posted 19 August 2012 - 02:04 PM

View Postdrixomanbeta, on 22 January 2012 - 08:55 PM, said:

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

Quote

%%a was unexpected at this time.

What can I do?

#27 User is offline   maxtorix 

  • Group: Members
  • Posts: 7
  • Joined: 03-February 10

Posted 19 August 2012 - 02:41 PM

View PostSiMoNsAyS, on 17 October 2004 - 09:16 PM, said:

i personally use

Quote

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 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,363
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 20 August 2012 - 05:58 AM

View Postmaxtorix, on 19 August 2012 - 02:04 PM, said:

View Postdrixomanbeta, on 22 January 2012 - 08:55 PM, said:

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

Quote

%%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.

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 - 2013 msfn.org
Privacy Policy