Ghost Solution Suite

 View Only
Expand all | Collapse all

Automating Ghost in WinPE

Migration User

Migration UserJun 16, 2010 02:15 PM

  • 1.  Automating Ghost in WinPE

    Posted Jun 07, 2010 12:09 PM
    When I was booting in Ghost through DOS, I was able to edit the AUTOEXEC.BAT file to force Ghost to begin the clone/create process automatically. I have a USB hard drive setup to boot to WinPE 2.0; is there any way to duplicate the automatic running of Ghost in WinPE? A solution I received earlier on a similar topic would appear to work (running a batch file after the winpeinit line), but I have to enter the command on the command line; I'm looking for a way to boot to the external and be able to walk away from it. Is this possible? Thanks.


  • 2.  RE: Automating Ghost in WinPE

    Broadcom Employee
    Posted Jun 08, 2010 01:50 AM

    In Ghost WinPE You can find a startup script by the name X:\Ghost\start.bat , You can edit this script or add any command you want to execute at the startup.


  • 3.  RE: Automating Ghost in WinPE

    Posted Jun 08, 2010 10:06 AM
    As mentioned above you could either edit the Startup script from
    C:\Documents and Settings\All Users\Application Data\Symantec\Symantec\Ghost\Template\common\winpe\ghost
     
    The start.bat file is in the Ghost folder and can be modified and be sure to modify the copy of WinPE that you are using as boot package.

    You could also modify it while creating a boot package using the Ghost Boot Wizard. The last screen before clicking the finish button would have this script. You could click on the "start editing" button and edit this. Once you finish with your editing click "stop editing" and finish the boot image creation.

    Hope this answers your query. Let me know if you have more queries on this.



  • 4.  RE: Automating Ghost in WinPE

    Posted Jun 08, 2010 03:28 PM
    I edited the start.bat file, but Ghost did not run automatically. Question: Is the command line commands the same for Ghost32.exe vs Ghost.exe? Below is the command line I've used using Ghost.exe and DOS:

    ghost.exe -clone, mode=restore,src=\5500\E5500.gho, dst=2 -sure

    I copied      -clone. . . .   after the start Ghost32.exe line in start.bat; it that the right place?


    Pardon the newbie questions; I'm new to WinPE.




  • 5.  RE: Automating Ghost in WinPE

    Broadcom Employee
    Posted Jun 09, 2010 01:45 AM
    If you are using DOS version then startup script is AUTOEXEC.BAT and if you are using WnPE then script is START.BAT;

    Commandline options for both the version of ghost are same , just make sure you have provided correct parameters ; once you boot the machine in DOS , run the Autoexec.bat again to see if it is working , if the script is fine , then it should work automatically when you boot  to DOS.



  • 6.  RE: Automating Ghost in WinPE

    Posted Jun 09, 2010 08:59 AM
    I believe you misunderstood me: I'm trying to move away from DOS; the command line I showed is what I used in the AUTOEXEC.BAT. I'm now using WinPE 2.0, and I need to edit the START.BAT file. I'm just not  exactly sure where to place the command line switches in the START.BAT file because after editing the START.BAT file, Ghost didn't begin the clone process automatically.



  • 7.  RE: Automating Ghost in WinPE

    Broadcom Employee
    Posted Jun 09, 2010 09:51 AM
    Ok, Then if your all src and dst path is correct , Then it should work ;
    to verify remove the -sure and run START.BAT to see if any problem.


  • 8.  RE: Automating Ghost in WinPE

    Posted Jun 09, 2010 10:04 AM

    Rick,

    You seem to have used the correct path.

    After Ghost32.exe just copy paste this

    -clone, mode=restore, src=\5500\E5500.gho, dst=2 -sure

    You could also use the switch

    -ja=session name
    (-ja stands for join automatically, session name should be the name of  session you use in the ghost cast server)

    this should be used before the -sure switch.

    You could also add these a parameters while creating a WinPE boot disk

    Please also find the link to the switches used for ghost below

    http://service1.symantec.com/support/on-technology.nsf/854fa02b4f5013678825731a007d06af/61d4fc31c0e5f59c8825734e0059c0aa?OpenDocument
     



  • 9.  RE: Automating Ghost in WinPE

    Posted Jun 09, 2010 10:11 AM
    Please remove the spaces after the comma (,)

    -clone,mode=restore,src=\5500\E5500.gho,dst=2 -sure

    try this and let know


  • 10.  RE: Automating Ghost in WinPE

    Posted Jun 09, 2010 03:12 PM
    We're really close, guys. Now I get an error message saying "Cannot open image file \5500\E5500.gho The system cannot find the path specified."

    The first time I got this message, I changed src=\5500\E5500.gho to src=x:\5500\E5500.gho, where x is the drive letter assigned by WinPE; I had the 5500 folder on the root of the drive.

    When that didn't work, I moved the 5500 folder into the Ghost folder, and changed the src path to src=x:\ghost\5500\E5500.gho. Got the same error message.

    Is there a specific place the image has to be on the drive, or am I making a mistake in editing the path to the image file?

    Just to make it clear, I have the image on the USB hard drive, not on a server. I travel to different schools in the district, and I need the portability. I hope this is possible. Thanks again for all your help; we are close.



  • 11.  RE: Automating Ghost in WinPE

    Broadcom Employee
    Posted Jun 10, 2010 03:04 AM
    To find out your image path is correct just browse through the image manually ; e.g if you have an image stored in one of the disk , find out the drive letter , using gdisk32.exe ; when you boot the machine in to WinPE the drive letter may not be the same as Active OS ; Just run Gdisk32.exe , you will get the information about the number of disks connected , lets say you have 2 disks , one is in build hard disk and second disk is USB ; lets say you want to know the drive for USB , run Gdisk32.exe 2 ; and you will get the drive letter of the disk , check the path is correct and then browse through ghost32.exe , if you can see the image then you are done ; or you can even specify the path as src=2:1\image.gho , where your image is one second disk and first partition.


  • 12.  RE: Automating Ghost in WinPE

    Posted Jun 15, 2010 11:14 AM
    Thanks for hanging with me.

    I believe I've found the source of the problem. Below is the command line I edited in the start.bat file on the USB hard drive:

    start ghost32.exe -clone,mode=restore,src=x:\5500\E5500.gho,dst=2

    I used X: because that's what is in the title bar of the DOS box after booting to WinPE

    (I've also used   start ghost32.exe -clone,mode=restore,src=F:\5500\E5500.gho,dst=2 because when I ran gdisk32.exe 2, it showed the assigned drive letter for the USB hard drive as F).


    When I booted to WinPE and ran start.bat, here is what is shown as the command line:

    start ghost32.exe -clone,mode=restore,src=\5500\E5500.gho,dst=2


    The src commands are different. The last command line is what I used originally when editing the start.bat file on the USB hard drive. Is there another place I have to edit this command line? Thanks again.

    UPDATE: 6/15/2010-- Just as a test, I changed the name of the gho file in the start.bat file. I still get the same error message when booting to the USB drive. When I run start.bat after booting to WINPE, the changes I made to the start.bat file did not take effect, yet when I look at the start.bat file from my computer, the changes are there. Does anybody know what's going on here? I'm at a loss.




  • 13.  RE: Automating Ghost in WinPE

    Posted Jun 16, 2010 02:15 PM

    Does anybody have an answer to my problem?


  • 14.  RE: Automating Ghost in WinPE

    Posted Jun 17, 2010 10:15 AM
    OK, when you boot WinPE, what you are actually doing is creating the equivalent of a RAMDISK which then loads the WinPE code and runs it from system memory. The X: drive is the default standard mapping used by the RAMDRIVE and you should not use that to try and save images to, as your available space in a 32 bit environment is going to max out at around 3.5Gb assuming you have at least 4Gb RAM.

    If you are booting WinPE from a USB device, you need to find the drive letter that the USB device is running on. If you have a single partition hard disk and an optical drive, then the next free drive letter is going to be E:
    However, this will vary where systems have multiple partitions or things like memory card readers which map to drive letters.

    My own preference for dealing with the start.bat file is to have it search each drive letter for my "GO.BAT" file, and once it finds it, it changes to that drive letter and runs my GO.BAT file. So then I can change GO.BAT on my USB device without having to edit the WinPE boot image each time.


  • 15.  RE: Automating Ghost in WinPE

    Posted Jun 17, 2010 01:38 PM
    Thanks for the reply, EdT.

    Below is the the start.bat file I have on the USB hard drive:

    set path=%path%;x:\ghost

    x:
    cd \ghost
    rem --- This will create primary OS drive configuration ---
    ghost32.exe /setosdrives /blind >> x:\ghost\startlog.txt
    start ghost32.exe -clone,mode=restore,src=F:\ghost\E5500.gho dst=2


    Except for the command line switches following the start ghost32.exe, the rest was generated when formatting the USB hard drive with WinPE. I ran gdisk32 2 to find the assigned drive letter for the USB hard drive, and F: was indicated; I edited the start.bat to reflect that, as seen above. However, after receiving the error saying the image file could not be found, I run start.bat from the DOS prompt, and ghost32.exe command line looks like this:

    start ghost32.exe -clone,mode=restore,src=\5500\E5500.gho dst=2

    This is the command line I entered the first time I edited the start.bat, and it returns no matter how I edit the start.bat file. I'm in the middle of another large project at the moment, so I can't try your suggestion until Monday, but I'm unsure what will happen since WinPE doesn't seem to be running the start.bat commands I entered.

    Thanks again for your help; I'm anxious to try your suggestion on Monday. I appreciate any comments/help you may have on what I've expressed in this response.



  • 16.  RE: Automating Ghost in WinPE

    Posted Jun 18, 2010 05:32 AM
    There is an inconsistency in your posting, which may be a typo, or an actual mistype which is the cause of your problem.

    In one place you have:
    start ghost32.exe -clone,mode=restore,src=F:\ghost\E5500.gho dst=2

    then you are trying:
    start ghost32.exe -clone,mode=restore,src=\5500\E5500.gho dst=2

    The second path has an additional 5500 folder in the path.
    Does this mean that you have the GHO file in two locations, or is the full and correct path something like
    F:\Ghost\E5500\E5500.gho   (and not F:\ghost\E5500.gho)

    As a test, you could try changing the line so that it just runs Ghost32.exe without any command line arguments, and try entering the parameters manually via the GUI - this will soon show up any issues with the location of the GHO file. 


  • 17.  RE: Automating Ghost in WinPE

    Posted Jun 18, 2010 11:05 AM
    The inconsistency in the command line is what the problem is. When I first edited the start.bat file, I used the following line:

    start ghost32.exe -clone,mode=restore,src=\5500\E5500.gho dst=2

    Here I had placed the image file inside a folder named 5500; when I had problems, I moved the image file out of the 5500 folder and into the Ghost folder and deleted the 5500 folder, thinking the problem was the start.bat file did a Change Directory command into the Ghost folder.

    Acting on the guidance of others on this post, I made changes to the start.bat file, eventually coming to this line:

    start ghost32.exe -clone,mode=restore,src=F:\ghost\E5500.gho dst=2

    where F: is the drive designated for the USB hard drive when I ran gdisk32 2.

    However, when I boot to WinPE on the USB hard drive, I get an error message stating the file could not be found and to verify the path. The path shown in the error message is   

    src=\5500\E5500.gho dst=2

    which is not the command line I have in the start.bat file. I close the error message box, and in the DOS prompt, I run start.bat; there I see the command line as I edited the last time (with the F: drive). This is what is confusing me; the path in the error message doesn't match the path I placed in the start.bat file.




  • 18.  RE: Automating Ghost in WinPE

    Posted Jun 18, 2010 11:35 AM
    Change the bat file so you get dropped into the command prompt instead of running Ghost.
    Check that the image file is where you expect on the F: drive.
    Check that Ghost32.exe is where you expect
    Change to the folder containing Ghost32.exe and run the command line manually.

    Also check that your USB drive is not formatted FAT32 if your ghost image files are greater than 2Gb in size.


  • 19.  RE: Automating Ghost in WinPE

    Posted Jun 21, 2010 04:11 PM

    I'm going to try your suggestions very soon, but first I want to relate something that I can't explain.

    Out of curiousity, I removed the start.bat file from the USB hard drive; when I booted to the hard drive, Ghost still ran, and I got the same error message about being unable to locate the file and to check the path. The path shown to the file is the same /5500/E5500.gho I get with start.bat on the hard drive. Where did that path come from?


  • 20.  RE: Automating Ghost in WinPE

    Posted Jun 23, 2010 07:48 AM
    I can only speak based on my experience of generic WinPE, but as you probably know, the WinPE boot process basically mounts the boot.wim file from your boot device (USB in your case), and by default the RAM based WinPE image is booted to the X: drive
    During the WinPE boot, a file called startnet.cmd is executed, which starts wpeinit.exe - and this file is in the x:\windows\system32 folder, which is part of the content of boot.wim.
    Normally, if generating a WinPE utility disk for general support work, I would add a line to startnet.cmd, which will locate the drive letter that the USB device is on, and then run my "go.bat" file from there, as this allows me to edit go.bat without having to mount boot.wim, edit it, and then unmount it.
    If your start.bat file is external to the WIM file that your USB device boots from, then I would guess that your wim file has additional content in its startnet.cmd file which is taking precedence over whatever is in your start.bat file.
    I don't have access to a GSS-created WinPE boot system, as I use my own WinPE system with an old version of Ghost32.exe to provide a portable boot and recovery environment.


  • 21.  RE: Automating Ghost in WinPE

    Posted Jun 23, 2010 10:02 AM
    Thanks for your patience with this, EdT; I've come this far on something new to me, and I would really like a solution.

    I'm going to redo the hard drive using a WinPe setup that doesn't involve Ghost, the one I got from Microsoft. I'll be in touch.

    Thanks again.


  • 22.  RE: Automating Ghost in WinPE

    Posted Jun 23, 2010 10:03 AM