Execute script after ghost

Hi !

I would like to execute a cmd, vbs, etc... script before the reboot of my computer after the ghost. I boot with WinPE, execute my imaging stuff with ghost32.exe and then i would like to execute a script that copies some files in my fresh ghosted computer before the reboot. Is it possible ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you use a task scheduled on user logout?

cegepexchangeAuthor Commented:
can we do that in winpe ? please tell me how !!! :)
As WinPE is a complete Windows environment the task manger should be available too (I did not check it)
 Acronis Global Cyber Summit 2019 in Miami

The Acronis Global Cyber Summit 2019 will be held at the Fontainebleau Miami Beach Resort on October 13–16, 2019, and it promises to be the must-attend event for IT infrastructure managers, CIOs, service providers, value-added resellers, ISVs, and developers.

Are you setting up the ghost imaging process to be scripted or are you calling ghost from the command prompt in WinPE?? or are you using a GUI?

If you are setting it scripted just add the commands to the end of the script. If not create a script and place it in the windows directory of the WinPE image. If you are using a GUI or Desktop in WinPE add an Icon in the GUI or to the WinPE Desktop.

To add stuff into WinPE you can use a tool called GImageX.  If you need more information about editing  WinPE  I can guide you in the right direction.
cegepexchangeAuthor Commented:
Hi bcruse,

I use pxe + tftp for deploying my winpe image and when the winpe boots, a script called start.bat is executed (with the 'call ghost32.exe') in it. The problem is that I need to start the ghost, wait for it to finish and THEN i would like to execute a command and then reboot. all my scripts are in the winpe image but i need a place to call them.
Thus the problem is "wait for it to finish"?

If so can't you use start/wait <ghost>?
Yes start/wait is what you want to use in the scripts.... Not just for ghost but for any following command also
cegepexchangeAuthor Commented:
Ok! Thanks!

If i hit "reboot" in the ghost32.exe, will it execute the next command anyway? Probably not?
No it will reset the computer before the next command executes.
cegepexchangeAuthor Commented:
Alright thanks! I'll try to check for a scheduled task before the reboot then.
Why not do a start/wait and then have ghost close (not reset). The next command would execute after the image is laid down on the disk. Then you could copy files, add registry entries, change the name, etc...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cegepexchangeAuthor Commented:
Good idea! Ill try that! thanks!
cegepexchangeAuthor Commented:
Thanks for all the help, it worked with start /wait until the ghost finish and then i copy my files then reboot. Thanks again!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Software

From novice to tech pro — start learning today.