DaGbyte Posted March 3, 2005 Share Posted March 3, 2005 I'm using Ghost32 in Windows PE and need to preserve the label name on the image that is coming down. Any ideas? I cannot change the ghost image, but need the partition label name to stay the same, or allow mw to change it via Ghost.-DaG Link to comment Share on other sites More sharing options...
ShrimpBoy Posted March 4, 2005 Share Posted March 4, 2005 Hi!First do something like..%COMSPEC% /C Dir [Drive you want to know the name] >[Path and file name to a writeable output file]Read the drive label in the outputed file...Do your ghost with a PLOAD (Partition load) instead of LOAD (Disk Load) and don't forget to specify the PLOAD format... src=[Disk or Image]:[Partition],dst=[Disk]:[Partition] Then simply execute this command...%COMSPEC% /C LABEL [Drive you want to name] [Name you want]and this is it...Hope this will help...ShrimpyOneP.S.: You can parse the output file with AutoIt (www.hiddensoft.com) or with WSH, and I think that with WSH 5.6 you can do the whole thing without output file!-------------------------------------------------- Dim WshShell, oExec, inputSet WshShell = CreateObject("WScript.Shell")Set oExec = WshShell.Exec("test.bat")input = ""Do While True If Not oExec.StdOut.AtEndOfStream Then input = input & oExec.StdOut.Read(1) If InStr(input, "Press any key") <> 0 Then Exit Do End If WScript.Sleep 100LoopoExec.StdIn.Write VbCrLfDo While oExec.Status <> 1 WScript.Sleep 100Loop-------------------------------------------------- Link to comment Share on other sites More sharing options...
IcemanND Posted March 4, 2005 Share Posted March 4, 2005 If you can run vbs scripts try these two:Get Volume Name:strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk")For Each objItem In colItems WScript.Echo "VolumeName: " & objItem.VolumeNameNextSet Volume Name:strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk where DeviceID='C:'")For Each objItem In colItems objItem.VolumeName = "Drive C" objItem.Put_NextPut it together with Ghost in the middle:strComputer = "." Set WshShell = WScript.CreateObject("WScript.Shell") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk where DeviceID='C:'")For Each objItem In colItems VName=objItem.VolumeNameNextWshShell.Run WshShell.CurrentDirectory & "\ghost\ghost32.exe -clone,mode=load,src=" & _ WshShell.CurrentDirectory & "image\gx110.gho,dst=1 -sure -fx -auto",1,trueFor Each objItem In colItems objItem.VolumeName = VName objItem.Put_NextI don't remember if Ghost32 automatically remounts the drive after ghosting or not. If not you will need to remount the volume after the ghost then let the last 4 lines run. 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