Video Screencast Help

I have a custom WIM using startnet.cmd to call ghost32.exe - I can't make the cmd window available

Created: 22 Mar 2013 • Updated: 27 Mar 2013 | 20 comments
This issue has been solved. See solution.

I have a WINPE file that I use for ghost. It has ghost32.exe in the system32 folder and that gets called from the startnet.cmd file. When ghost launches the command window is minimized and not available. If I unminimize it and look at it, it just sits there with a flashing cursor until I close Ghost.

This is what it looks like:

I would love to have access to the command window while Ghost is launched.

I know the Ghost WIM that gets made by the the ghost suite wizard on the Vista platform actually did this but since I am making my own WIM's now I seem to have lost that functionality.

This is what the Ghost solution suite wizard makes for you. It works great:

Can anyone please tell me how to make that command window active and available WHILE ghost is running? i know it is possible because it works fine if you build a vista based WIM using the built in utility Ghost provides.

My startnet.cmd looks like this:


start ghost32.exe -ib -rb

Operating Systems:

Comments 20 CommentsJump to latest comment

EdT's picture

As far as I am aware, you cannot have an active command windows while a command program is running, as WinPE is a command line interface and NOT a windows environment. Certainly in all my work with the WinPE 2 release, I have not seen any option to run what would be two separate command windows at the same time.  I have not tried spawning a command window - perhaps it would be worth testing whether running ghost via cmd.exe /k ghost32.exe might offer such a solution, but one other thing you could try would be to pull out one of your former WinPE setups made from Ghost Solution Suite and check out what command line options are used.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

buck614's picture

I don't think that is the case. 

As I said the one that is built by Symantec's wizard DOES work so it cant be a Winpe limitation.

I have actually tried the /k option with several variations and that does not work.

The Wim built by Symantec is not a standard build. Not only is there nothing in the startnet.cmd file other than 'wpeinit' I can't find ghost32.exe on the WIM Anywhere. I think they hide what they are trying to do to protect their software. I really don't know.

Again ... Symantec knows how to make this work because the WIM that is built using their own wizard works perfectly. So I would love to know how they do it.

Terry BU's picture

in your startnet.cmd file, you need to put this line before you do anything

start /min cmd.exe

or get rid of the min if you dont care if its minimized

this gets you another command prompt in the background you can use

EdT's picture

If I recall correctly, wpeinit calls a batch file in the system32 folder of the WinPE boot image. There are certainly a number of batch files in a standard WinPE image, so it may be worth a few minutes of your time to check out your Ghost WinPE disk's batch files.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

buck614's picture

I have checked all of the batch fils in system32 and windows in my WIM and the vista WIM that symantec makes. I can;t find anything significant.

As a matter of fact the vista WIM that symantec makes only has one line inthe startnet.cmd file


Ghost32.exe gets launched some other way that I am unable to determine.

Terry BU's picture

what version of the PE are you running?  the one built in to the ghost boot creator?

I use PE 3.0 for a nice boot CD, and the start command i posted above does work.  i use that to spawn other tasks i dont want  to wait to close out, such as VNC so i can remote into the PE session

buck614's picture

What you are doing makes sense and will certainly work BUT you are not launching Ghost.

I am using the WIM off of the Windows 7 32bit disk as a base. From there I use Windows Deployment Workbench to add drivers. I use Imagex to mount it and add the ghost32.exe file and edit the startnet.cmd file to launch Ghost.

I believe that it is NOT working for me because Ghost is actually running. If it isn't running that I have an active command window.

Like I said the WIM that is built by the Ghost solution suite works fine.

Terry BU's picture

maybe you and i are thinking of different things, or i just misunderstanding

i create my own WIM files for boot DVDs using the WAIK.  i insert ghost into them, and i insert scripts that call ghost too.  i use ghost to talk to either the DVD for files, or go out over the network.  this works in one CMD window.  in other CMD windows i can run other tools.  

my startnet.cmd looks like this:

wpeutil disablefirewall
start /min cmd.exe
cmd /c x:\scripts\vnc.cmd
you can then run scripts that do their thing in the other CMD windows.  i can run a script that in another window runs.  could i do that a better way, probably.  but this works to give an additional CMD window (that in my script is minimized to the lower left corner)
buck614's picture

So are you saying that one of those two cmd files has a statement to launch ghost32.exe? Can I see that if it is the case?

So you run Ghost and still have a command window available WHILE ghost is running?

Terry BU's picture

just to compare (and again, i am sorry if i misunderstand what you are doing), i build my WIM like this (running from the deployment tools command prompt in the WAIK):

set /p _location= Full Directory where you want to build this (it must not exist already):
copype amd64 %_location%
copy %_location%\winpe.wim c:\%_location%\ISO\sources\boot.wim
dism /mount-wim /wimfile:%_location%\winpe.wim /index:1 /mountdir:c:\winpe\mount
copy c:\bootcd\gimagex.exe c:\winpe\mount\windows\system32\gimagex.exe
xcopy c:\bootcd\Images c:\winpe\mount\Images /y /e /i
xcopy c:\bootcd\scripts c:\winpe\mount\scripts /y /e /i
xcopy c:\bootcd\Ghost64 c:\winpe\mount\windows\Ghost64 /y /e /i
xcopy c:\bootcd\PE_VNC c:\winpe\mount\PE_VNC /y /e /i
xcopy c:\bootcd\startnet.cmd c:\winpe\mount\windows\system32\startnet.cmd /y /e /i
copy c:\bootcd\getmac.exe c:\winpe\mount\windows\system32\getmac.exe
copy c:\bootcd\winpe.bmp c:\winpe\mount\windows\system32\winpe.bmp /y
dism /image:c:\winpe\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\amd64\winpe_FPs\"
dism /image:c:\winpe\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\amd64\winpe_FPs\"
dism /image:c:\winpe\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\amd64\winpe_FPs\"
<add drivers>
dism /unmount-wim /mountdir:c:\winpe\mount /commit
copy c:\winpe\winpe.wim c:\winpe\ISO\sources\boot.wim /y
SET /p _file= name of file (NO .ISO extension!):
oscdimg -n -bc:\winpe\ c:\winpe\ISO c:\winpe\%_file%.iso
buck614's picture

Wow. that looks very 'Proper procedure' to be honest. I do it very differently.

I just take the base wim from the cd and open it using imagex and add the ghost file and the startnet.cmd batch file.

i assume it really doesn't matter though. I am thinking that the fix here for me is to call another batch file from the startnet.cmd file.

So I would have:


start /min cmd.exe
start ghost32.exe -ib -rb
Does that look like it basically?
Terry BU's picture

yup, that looks good.  the current window will wait for Ghost to finish out, but you will still have the other one.

I actually have all that code split across CMD files that i call in succession to build the WIM.  i have a TXT file to myself explaining what they do, what order to call, why, etc, otherwise i will forget...  I very rarely have to build them unless i get a driver that is unsupported in the Ghost PE, or (even rarer) in the PE 3.0 area.

EdT's picture

May I just add that the WAIK tools allow you to configure a WIM file which has your choice of add-ins (such as the ability to run WMI ), so using the basic WIM off the CD gives you an environment with an unknown add-in content.  That is the reason both Terry and I prefer to roll our own, which is not actually that difficult.

I have documented my procedure here:

When I create a WinPE bootable USB key or USB hard disk, I include a command in wpeinit which looks for a "go.bat" file in the root of the bootable device, and runs it if found. That allows me to change the activity that occurs when WinPE starts up without having to recreate the WIM each time.

Since you can also load device drivers from the WinPE command line using DRVLOAD, it also allows you to trial new drivers before recreating the WIM, or just add them externally and load them at startup.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Terry BU's picture

there are 3 scripts i use to run ghost.  the scripts do this:

ghost64 -clone,mode=restore,src=X:\Images\winpeuni.gho,dst=1 -SZEE


set /p _session= Name of GhostCast Session to back up to: 
ghost64 -clone, src=1, dst=@mc%_session%
or just
ghost64 -szee
i call them that way since i put their folder in the path earlier (they are all in that scripts folder i copied and then the setpath file).  that window is then tied up with ghost until it is done, but there is another window open since i called the start cmd.exe in the startnet.cmd before doing any of those