MSFN Forum: More Of A Ghost Question Than - MSFN Forum

Jump to content



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

More Of A Ghost Question Than Rate Topic: -----

#1 User is offline   DaGbyte 

  • Newbie
  • Group: Members
  • Posts: 37
  • Joined: 24-January 05

Posted 03 March 2005 - 12:29 PM

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


#2 User is offline   ShrimpBoy 

  • Master Shrimp!
  • Group: Members
  • Posts: 43
  • Joined: 15-February 05

Posted 03 March 2005 - 09:26 PM

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...

ShrimpyOne

P.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, input
Set 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 100
Loop

oExec.StdIn.Write VbCrLf

Do While oExec.Status <> 1
WScript.Sleep 100
Loop

--------------------------------------------------

#3 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,239
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 04 March 2005 - 08:15 AM

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.VolumeName
Next


Set 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_
Next


Put 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.VolumeName
Next

WshShell.Run WshShell.CurrentDirectory & "\ghost\ghost32.exe -clone,mode=load,src=" & _
     WshShell.CurrentDirectory & "image\gx110.gho,dst=1 -sure -fx -auto",1,true

For Each objItem In colItems
     objItem.VolumeName = VName
     objItem.Put_
Next


I 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.

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