Advanced Drive formatting and CDROM Drive letter Assignment RRS feed

  • Question

  • I am having an issue with making MDT setup systems in the way that a project requires - and I am wondering if anyone has experience in making MDT output a system like the following:

    Server 2008R2 - Latest MDT Software versions

    Disk 0 - 1:System Reserved 2:Windows C 3:Recovery 4:Data E:

    Disk 1 - 1:Data D:

    CDROM: X:

    The problem seems to be that, even if I try to format the drives during setup - they will format but be marked as "offline" and thus not be given a drive letter.  This makes the system set the CDROM to D:, and I need the hard drive to be D:.  

    I tried changing the CDROM drive letter via a bat file in the LTIBootstrap.vbs script before it launches the main MDT process, but changing the CDROM drive moves the source folder that the CDROM is currently running from and the process just disappears.  I am going to try adding in a wait statement to see if that helps.

    oShell.run "C:\Windows\System32\Set_X.cmd", 1, true

    Then the next thing that runs is:

    "Find LiteTouch.wsf and run it"

    My hope was that the file would be loaded in memory and run even though the drive was moved, and then find the next script and chain to it.

    I can't find a way to force the CDROM letter inside Windows to be anything other than D BEFORE the MDT install portion begins, and also I sometimes need this to run from a bootable USB which will then take up the D: and E: drive letters and break all my scripts and attempts to move the drive letters around post OS install.

    I can't just change the drive letters at the end because I need to install software, and changing the drive letters after would cause the paths to change.

    Any help would be appreciated, making Linux kickstart my drives was comparatively easy so I am hoping I am just missing something easy with MDT.


    Tuesday, June 6, 2017 4:38 PM

All replies

  • You should be able to just do it from a PowerShell script in the State-Restore action:

    Get-WMIObject -Class Win32_Volume -Filter 'DriveType=5' | %{ $_.Name } | write-host

    $CD = Get-WMIObject -Class Win32_Volume -Filter 'DriveType=5' $CD.DriveLetter = 'M:' $CD.Put() | out-null Get-WMIObject -Class Win32_Volume -Filter 'DriveType=5' | %{ $_.Name } | write-host

    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Wednesday, June 7, 2017 6:00 AM
  • Thanks for the reply, it got me kind of the way there but it has left me in an odd spot.

    After the drive change, the scripts keep running - but D: is not released for use and thus my formatting fails.

    I find that I have to run mountvol D: /D to release the drive - but when I run it from powershell it does not seem to work.

    As a workaround, I tried calling it as a CMD script - but then the Powershell scripts never run (brings up a glitched wizard.hta screen that just hangs there) after that happens.

    So now I get to the end of the MDT process, with my errors, and if I open a command or PS window manually and run: mountvol D: /D

    It frees up the drive, and then when I manually run the script it formats everything properly.

    Do you know the proper way to call out this legacy command from with powershell that won't break it - or is there a new commandlet which does the same thing?

    I tried just running it like this at the end of your CDROM script:

    "mountvol D: /D"

    But it had no effect.  Running it manually does work though.

    • Edited by martin0641 Wednesday, June 14, 2017 7:40 PM Additional clarity.
    Wednesday, June 14, 2017 7:38 PM
  • So, I made a PS script and I called it within the sequence:

    & cmd.exe /C "mountvol.exe d: /d"

    Pretty simple, and it works - but as soon as it happens it drops me out of the task sequence and I see Wizard.hta where it hangs.

    Everything stops after the D: is made available, and the CDROM is at X:

    I tried to post images but they won't let me...


    Wednesday, June 14, 2017 10:53 PM