Jump to content











Photo

How to change the Drive Letter assigned to PE?


  • Please log in to reply
10 replies to this topic

#1 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 April 2007 - 04:09 PM

How to change the Drive Letter assigned to PE?

This methode works for all kinds of drives, like HDD, USB-Stick, USB-HDD, USB-CDROM.
However it does not work for CDs. As soon as you put your CD into a different CD-Drive it reverts back to X:

How to do it?

First you need to attach the drive you want to put your PE on to your computer. If the drive is a fixed one and is in another computer located, perform the following steps on that computer.

- start up Windows - any XP or PE will do
- start Explorer and check which drive letter your drive has gotten (Remeber that or write it down! :cheers: )
- start Regedit and navigate to HKEY_LOKAL_MACHINE\SYSTEM\MountedDevices
- mark MountedDevices
- export that entry and remember where you put it! :cheers:

Now get the file to the computer you will build your PE on. The file is already on that computer?
Great! :cheers: Less work for you. :cheers:

Now start WB and set your project up. Once your done with that, make a few final changes.

- go to 'Define Fundamentals' and set the 'PE Drive Letter' to C: or whatever you like.
- go to 'Create ISO' and uncheck it, just like 'Run ISO in ...'

Run your project.

Once the project finishes, don't close WB!!!

Now it's time to take care of the previously exported Registry entries.

Go to the file right click on it and choos edit not open! If you do choose open by accident, answer the following dialog with NO or you're royaly screwed! :cheers:

If you've done it right Notepad will have opened and show you your reg file.
We keep:
Windows Registry Editor Version 5.00



[HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices]
and start deleting all entries but the one \\DosDevices\\with the drive letter that was appointed to the drive you wanna put PE on, when you've exported those entries.
An entry always starts with
"\\
and ends with
00

After slimming down the reg file, we still have to modify it a bit.
First we change the drive letter to what we entered in the Define Fundamentals script.
If you've followed my lead, that should be C:.
It should now read
"\\DosDevices\\C:"=hex:

And after we change HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices to HKEY_LOCAL_MACHINE\setupreg\MountedDevices we're done and can save the file and close the editor.

Now we need to get those settings we just created to the right place and that is the setupreg.hiv in the i386\system32 folder in your Target folder.
To get it there, do the following:
- start Regedit
- mark the HKEY_LOCAL_MACHINE
- go to the menu file and click on 'load hiv' or something similar :cheers:
- you'll get a file choosing dialog, navigate to 'your taget folder'\i386\system32\setupreg.hiv and click open
- in the now presented dialog window enter
setupreg

- go to you modified reg file and double click it, say YES to the following dialog
- go to the menu file and click on 'unload hiv' or similar

Puhhh, That was that. :cheers:

All that's now left to do, is to actually create the ISO.
We switch back to WB (which we left hopefully clever open) go to the 'create ISO' script and press the button 'Create a new ISO file'.


Too complicated?

Wait a few days, i'm sure Peter will include this in his buildmodel. :cheers:

:cheers: :thumbup:

#2 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 April 2007 - 04:13 PM

Too complicated?
Wait a few days, i'm sure Peter will include this in his buildmodel. :cheers:


You are rather optimistic :cheers:
Maybe a few weeks :cheers:

Peter

#3 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 April 2007 - 05:45 PM

You are rather optimistic :cheers:
Maybe a few weeks :cheers:

Peter

It's basicly just a regwrite and the user has to supply the hexdata for his drive into your form.
Nothing complicated! :cheers:
For ramboot it should even be possible to hardcode the complete string.

:cheers: :cheers:

#4 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 April 2007 - 05:48 PM

It's basicly just a regwrite and the user has to supply the hexdata for his drive into your form.
Nothing complicated! :cheers:
Forramboot it should even be possible to hardcode the complete string.

:cheers: :cheers:

Maybe, but you forgot that in my second profession I'm rather busy with family, children, grand children etc ...
Attached File  010_Familie_2002.jpg   1.22MB   219 downloads
BTW: Old picture. She small ones are now nearly 5 years old and have a brother of about 2 / 3 each.

Peter :cheers:

#5 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 April 2007 - 06:01 PM

Maybe, but you forgot that in my second profession I'm rather busy with family, children, grand children etc ...
Attached File  010_Familie_2002.jpg   1.22MB   219 downloads
BTW: Old picture. She small ones are now nearly 5 years old and have a brother of about 2 / 3 each.

Peter :cheers:

:cheers: Me too!

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 April 2007 - 06:04 PM

:cheers: Me too!


Dann hast Du gewonnen!

Peter :cheers:

#7 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 11 April 2007 - 06:50 PM

That's a nice family photo! :cheers:

MedEvil, I'm still astonished with the possibility of selecting the drive letter without any hex editing any files, but since all we need is a reg key value from our host registry system, can't a single script automate it?

Script interface can use a box to select the drive from where to extract info

Then all that is needed is to read the entry from HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices, load the hive and write the new value back.. (unless something more is needed, is it?)

Congratulations on your sucess with this long lasting goal and a nice tutorial too!

:cheers:

#8 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 April 2007 - 06:59 PM

...,
can't a single script automate it?

Some posts above MedEvil already wrote

Wait a few days, i'm sure Peter will include this in his buildmodel.

(And I responded to need more time because of family , photo , ....)

Peter :cheers:

#9 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 April 2007 - 10:02 PM

Can be done.
Read entry - change entry - load hive - write entry -unload hive :cheers:

But in this case a standalone script makes no sense, since it is closely tied to the PeDriveLetter and that's already in Peters Buildmodel.

But if someone can't wait and want's to write a script. Be my guest.

:cheers: :cheers:

#10 vrocco

vrocco
  • Members
  • 3 posts
  •  
    United States

Posted 08 July 2007 - 07:43 PM

Well I needed it for a project immediately, so I wrote a small script. Just give it the drive letter your drive mounts as in Windows, the path to setupreg.hiv and the drive letter you want it to mount as in the WinPE.

It reads the registry value for the requested drive, loads the hive and creates the registry key for the new drive letter. Then unloads the hive.

It did what I needed it to do. Hope it helps someone out. Script is written in Autoit because I am not a 1337 coder. Thanks again to MedEvil for the method.

Enjoy!

Vito

Attached Files



#11 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 July 2007 - 10:03 PM

Nice of you vrocco to post your program for others to enjoy, keep up the good work. :1st:

I would just like to point out, that there already exists a script for that sort of thing.

:thumbup:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users