MSFN Forum: Change default drive letter - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Change default drive letter Rate Topic: -----

#1 User is offline   pr1ngl3 

  • Group: Members
  • Posts: 3
  • Joined: 30-June 11
  • OS:none specified

Posted 10 January 2012 - 02:35 PM

After 2 full days of searching and researching I have come up blanks so was hoping someone could help me.

I have hundreds of scripts written by 3rd parties that I need to incorporate into a WIM, the trouble is all the scripts are hard coded to reference an X: drive. I can not rework the scripts becuause of licensing and liabilities so need to find a way of getting WinPE to alllow me to physically set the drive letter it loads as the RAM drive and subsiquently mount a device as the X: drive.

I have looked into SUBST but it will obviously not allow substitution of the %Systemdrive%
I have looked at DOSKEY but the complexity because of the number of hardcoded references to X:\<whatever>\<whatever>\<whatever> far outweighs the possibilities
I have looked at the options within bcdedit > devobject > {ramdisk} but there is nothing associated with the drive letter

I can't believe MS would hardcode the drive letter so deeply that it can not be changed, I know with the intruduction of WMI the registry needs a hardcoded reference, but surely this can be dynamic up to the point of creating the RAM Drive, even if this means rebuilding the sdi.


#2 User is offline   cdob 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 757
  • Joined: 29-September 05

Posted 10 January 2012 - 06:03 PM

WinPE with SystemRoot on C:\ (or anything)
http://www.msfn.org/...-c-or-anything/

#3 User is offline   daremo 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 26-February 12
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 27 February 2012 - 09:26 AM

View Postpr1ngl3, on 10 January 2012 - 02:35 PM, said:

After 2 full days of searching and researching I have come up blanks so was hoping someone could help me.

I have hundreds of scripts written by 3rd parties that I need to incorporate into a WIM, the trouble is all the scripts are hard coded to reference an X: drive. I can not rework the scripts becuause of licensing and liabilities so need to find a way of getting WinPE to alllow me to physically set the drive letter it loads as the RAM drive and subsiquently mount a device as the X: drive.
......
I can't believe MS would hardcode the drive letter so deeply that it can not be changed, I know with the intruduction of WMI the registry needs a hardcoded reference, but surely this can be dynamic up to the point of creating the RAM Drive, even if this means rebuilding the sdi.


You can try the following:

First, mount the boot.wim file which is the winPE-
Dism /Mount-Wim /WimFile:D:\data\boot.wim /index:1 /MountDir:D:\data\tmpWimMount
which mounts the boot.wim file (located at D:\data\ folder) to a new folder (D:\data\tmpWimMount)

Then ask for PE environment settings-
Dism /image:D:\data\tmpWimMount /Get-PESettings
One of these information displayed is the windows root directory (such as "X:$windows.~bt\windows")

Alternatively, you can also get the Windows Root Directory information directly by issuing the following command-
Dism /image:D:\data\tmpWimMount /Get-TargetPath
You can reset the root directory to something you want. Most of the time, for custom WinPE, and especially when building Win7PESE via winbuilder, or for LastOS custom PE via the lastos builder, you need to set the windows root directory to "X:\". You must issue-
Dism /image:D:\data\tmpWimMount /Set-TargetPath:X:\ (or some other drive letter)

Finally, you have to commit the changes and unmount the boot.wim image-
Dism /Unmount-Wim /MountDir:D:\data\tmpWimMount /commit

Repeat the above steps for boot.wim index=2 image as well, and make sure the target path is the same as what you have specified for boot.wim index=1 image. Commit changes and unmount boot.wim index-2 image.

Then try out your scripts and see if that works.

Share this topic:


Page 1 of 1
  • 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 - 2011 msfn.org
Privacy Policy