Nothing amazing. just a piece of useful code. Works out the CDROM Drive letter in Windows PE (not the X Drive, but anything mounted on the CD outside of that) and then runs something from it.
Thought I would share..
' ***************************************************************
' * Script to find the CDROM Drive in Windows PE
' * and then launch a process from it
' * Paul Davey
' ***************************************************************
Set FileSystemObject = CreateObject("Scripting.FileSystemObject") 'Create a filesystem object
Set Drives = FileSystemObject.Drives 'Create a drives collection
Set wshShell = WScript.CreateObject ("WSCript.shell")
' Create an array of letters that are CDROM Drives
Dim cddrvletter ' Holder of the CDROM drive that contains the GHOST files.
For Each DiskDrive in Drives
If diskdrive.drivetype = "4" Then ' This drive is a CDROM Drive
If diskdrive.driveletter <> "X" Then ' X Is the CDROM OS Disk, we dont want this one.
cddrvletter = diskdrive.driveletter
End If
End If
Next
' Run the program from CD
wshshell.run cddrvletter & ":\notepad.exe", 1, True
' Clean up after ourselves
Set Drives = nothing
Set FileSystemObject = nothing
set wshshell = nothing