How to get standard and error output for a command executed in Ghost start.bat

Article:HOWTO31342  |  Created: 2010-09-20  |  Updated: 2013-09-09  |  Article URL
Article Type
How To


Basically, any standard and error outputs regarding Ghost start.bat are not displayed during WinPE boots because "echo off" is set on top of startnet.cmd, which is executed automatically and executes the start.bat during WinPE boots. How do you get logs standard and error outputs if you have additional commands(e.g. "net use") in Ghost start.bat?


  1. Click "Start editing" button
    on the page titled "Symantec Ghost Boot Wizard - Review" in the Ghost Boot Wizard
  2. To get standard and error output for a command,
    add ">> x:\ghost\startlog.txt 2>&1" or ">> <a file path> 2>&1" in the start.bat as follows.
    NOTE: The file should be a writable file.

    --- start.bat ---
    set path=%path%;x:\ghost

    net use G: //<machinename>/<sharename >/user:<domain\user name> < user password> >> x:\ghost\startlog.txt 2>&1

    cd \ghost
    rem --- This will create primary OS drive configuration ---
    ghost32.exe /setosdrives /blind >> x:\ghost\startlog.txt
    start ghost32.exe
  3. Finish the creation of the Ghost boot disk containing the start.bat.
  4. Start Ghost executable with the Ghost boot disk.
  5. Quit Ghost executable.
  6. To check standard and error output, open the file at step 2 on command prompt.

    x:\ghost> notepad startlog.txt
  7. Backup the file to persistent storage before WinPE is shutting down,
    if it's non-persistent storage file like startlog.txt on RAM disk and if the backup is needed.


Article URL

Terms of use for this information are found in Legal Notices