Coolsights2000 Posted May 11, 2005 Share Posted May 11, 2005 HI all!I have seen allot of post on asking how to set the path for a CD/DVDso 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 LogonECHO Set CDROM Path During T-12 Stage Stufffor %%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%^ /fNote 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.cmdfrom this web pagehttp://unattended.msfn.org/intermediate/users.htmEnjoy Mac! Link to comment Share on other sites More sharing options...
erik_demon Posted May 11, 2005 Share Posted May 11, 2005 (edited) Hey Should this mean that we now have a perminent variable?, that would be superB EDIT:I tried it, it works great I haven't tested it at T=12 but I run the lines in windows, rebooted and the variable is there.THANKS ALOT!!! Edited May 11, 2005 by erik_demon Link to comment Share on other sites More sharing options...
Yzöwl Posted May 11, 2005 Share Posted May 11, 2005 You may also be able to set it before then, from detached.cmd, (T39), using the same 'reg add' etc. Might be worth a try! Link to comment Share on other sites More sharing options...
erik_demon Posted May 11, 2005 Share Posted May 11, 2005 I tested it with a format and it works great 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 Stufffor %%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 Link to comment Share on other sites More sharing options...
evilvoice Posted May 11, 2005 Share Posted May 11, 2005 there is one problem with your command...winpath isnt correct, it needs to be ^%WINPATH^% to not expand winpath to or whatever... Link to comment Share on other sites More sharing options...
Coolsights2000 Posted May 11, 2005 Author Share Posted May 11, 2005 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 mirascanI'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! Link to comment Share on other sites More sharing options...
Yzöwl Posted May 11, 2005 Share Posted May 11, 2005 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 More sharing options...
Coolsights2000 Posted May 11, 2005 Author Share Posted May 11, 2005 I know what you mean about an escape character but in this case doing it your way returns a blank variable ........I don't know why it returns a blank vaiable... Just PFMI will give ^%WINPATH% a test drive on the next run Link to comment Share on other sites More sharing options...
Yzöwl Posted May 11, 2005 Share Posted May 11, 2005 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 More sharing options...
Coolsights2000 Posted May 11, 2005 Author Share Posted May 11, 2005 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 More sharing options...
TheeBeets Posted May 11, 2005 Share Posted May 11, 2005 [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 More sharing options...
Yzöwl Posted May 12, 2005 Share Posted May 12, 2005 @ Coolsights2000Often %% is preferred i.e. %%WINPATH%% Link to comment Share on other sites More sharing options...
Coolsights2000 Posted May 12, 2005 Author Share Posted May 12, 2005 %%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 variableso %WINPATH%\popupcop\popupcop.cmdexpands to and becomesD:\install\popupcop\popupcop.cmdwhen the code is runtwo 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^2Mac! Link to comment Share on other sites More sharing options...
Coolsights2000 Posted May 12, 2005 Author Share Posted May 12, 2005 [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<{POST_SNAPBACK}>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 More sharing options...
evilvoice Posted May 12, 2005 Share Posted May 12, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now