Jump to content

%CDROM% Path


Recommended Posts

HI all!

I have seen allot of post on asking how to set the path for a CD/DVD

so you can install programs from the CD/DVD..

I think I figured out a way to set the Windows CD installation path during the t-12 Stage ...

This is a rough draft the next time I do a test run I will test it...

The trick of the eye is.........

When you set a Environment variable the computer has to be rebooted before the Environment variable will be seen... So what you do is add the code below during the t-12 stage this way you will have a Environment variable pointing to to the CD/DVD. In this case the Environment variable %XPCD% will be set to the install directory on the windows installion CD/DVD after the computer reboots at the end of the GUI-mode Setup.. The Environment variable will be seen at the start on the First Logon

ECHO Set CDROM Path During T-12 Stage Stuff

for %%i 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 %%i:\WIN51 set CDROM=%%i:

set WINPATH=%CDROM%\Install\

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "XPCD" /t REG_EXPAND_SZ /d ^%WINPATH%^ /f

Note the lines above are one liners.. They show as two lines even on my big screen..... there is 4 one liners...

For those that don't know where to insert this just add it to the useraccounts.cmd

from this web page

http://unattended.msfn.org/intermediate/users.htm

Enjoy Mac!

Link to comment
Share on other sites


Hey :hello:

Should this mean that we now have a perminent variable?, that would be superB :w00t:

EDIT:

I tried it, it works great :thumbup

I haven't tested it at T=12 but I run the lines in windows, rebooted and the variable is there.

THANKS ALOT!!! :thumbup

Edited by erik_demon
Link to comment
Share on other sites

I tested it with a format and it works great :thumbup

I did it like this:

- I created CD-path.cmd in the $OEM$ folder, for me it looks like this:

ECHO Set CDROM Path During T-12 Stage Stuff

for %%i 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 %%i:\cd.txt set CDROM=%%i:

set WINPATH=%CDROM%\

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "CDDRIVE" /t REG_EXPAND_SZ /d ^%WINPATH%^ /f

- added the following to cmdlines.txt:

[COMMANDS]
"CD-path.cmd"

It works like a charm. %CDDRIVE% Is now a permanent variable!!

I would recommend this to everyone :thumbup

Link to comment
Share on other sites

The carrot has to be on the outside ......

and it is expandable string

I just did test run and it worked great for me to.....

I only had three things in my short test list that would not install from the CD..

Netfx, my camera drivers and mirascan

I'll just move those back to the C drive install directory..

or I will use a sfx file that expands to the C: drive..

Not sure how I want to do them yet,,

I know they will load using these two ways....

Enjoy Mac! :D:D

Link to comment
Share on other sites

evilvoice is correct, the caret is used to escape the character it precedes i.e in this case always ^%.

However, your command should still work, because with the first percent character escaped, the second one will not function to expand the variable, therefore meaning that ^%WINPATH% should also be okay

Link to comment
Share on other sites

Sorry, you caught me mid edit.

Because I noticed you here, I thought I would explain in a little more detail.

Try what I used in the emboldened, italicized text!

****, done it again!

Link to comment
Share on other sites

I did a short play CMD and the ^%...% without the second carrot works to .....

Hum what ever works just wished there was something I could find that is the official way to do buisness...

when I used the ^%...^% it put the /f in the register ...

I even tried playing with quote too.... no go!!!!

Link to comment
Share on other sites

[COMMANDS]"CD-path.cmd"

Is this possible to be run from Winnt.sif and could someone plz post a copy of what wpi.cmd should look like in order to boot from cd and perhaps even put on unattended website as it makes things a lot easier, Thx

Link to comment
Share on other sites

%%WINPATH%% puts %WINPATH% in the register key.... that will refer to nothing...

When you use the ^%WINPATH% it puts the address of the CD/DVD and a folder if used.. Like example D:\install So now when you use %WINPATH% in your other code it will be expanded to D:\install .... D:\install will be substitutes everywhere where you put %WINPATH%

%WINPATH% = D:\Install This is a set me to environment variable

so

%WINPATH%\popupcop\popupcop.cmd

expands to and becomes

D:\install\popupcop\popupcop.cmd

when the code is run

two differenmt animals here..

one is the value of a dollar

and the other is it takes one dollar to purchase this.....

LOL just like algebra here what is c^2 if a^2 + b^2 = c^2

Mac!

Link to comment
Share on other sites

[COMMANDS]

"CD-path.cmd"

Is this possible to be run from Winnt.sif and could someone plz post a copy of what wpi.cmd should look like in order to boot from cd and perhaps even put on unattended website as it makes things a lot easier, Thx

Why be difficult just put it at the t-12 mark ....... you don't need to use it till after the first logon... and it will not be seen as a environment variable till the computer reboots anyway ....... At the time you add the value it is only a temp value ........

when you reboot it becomes a true environment variable

Link to comment
Share on other sites

well, it looks like you want %WINPATH% to expand to whatever...and in that case, you shouldnt need the caret at all...and I mentioned in my post that if you DID NOT want it expanded, then it was wrong...thats all, but from the post above this, you do want it to expand to D:\install or whatever. So, it is correct the way you have it, tho you could get rid of the carets, I would assume.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...