How to troubleshoot the failure of "net use" to map a network drive in Ghost start.bat
search cancel

How to troubleshoot the failure of "net use" to map a network drive in Ghost start.bat

book

Article ID: 179928

calendar_today

Updated On:

Products

Ghost Solution Suite

Issue/Introduction

Question/Issue:

 
When using "net use" to map a network drive in Ghost start.bat, the command might fail with a system error like following.
 
e.g.
System error 53 - The network path was not found.
System error 67 - The network name cannot be found.
System error 85 - The local device name is already in use.
 
However, 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 troubleshoot the failure of "net use" to map a network drive in Ghost start.bat?
 

Environment

Ghost Solution Suite 3.x

Resolution

The following will add additional command lines to the start up that will aid in troubleshooting the failure point. 
  1. Click "Start editing" button on the page titled "Symantec Ghost Boot Wizard - Review" in the Ghost Boot Wizard.
     
  2. To add commands to troubleshoot the failure and to get the standard and error output as follows,
    edit "start.bat".

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

    rem --- To check network connections. ---
    netsh interface ipv4 show interface >> x:\ghost\startlog.txt

    rem --- To check network configuration. --- 
    ipconfig >> x:\ghost\startlog.txt

    rem --- To check workstartion is started. ---
    net config >> x:\ghost\startlog.txt 2>&1

    rem --- Create script for diskpart command ---
    echo list volume >> x:\ghost\dpscript.txt

    rem --- To check which drive is already used. ---
    echo diskpartStart >> x:\ghost\startlog.txt
    diskpart /s x:\ghost\dpscript.txt >> x:\ghost\startlog.txt 2>&1
    echo diskpartEnd >> x:\ghost\startlog.txt

    rem --- To execute net use to map a network drive. ---
    echo netUseStart >> x:\ghost\startlog.txt
    net use G: \\machinename\sharename /user:ghost ghost >> x:\ghost\startlog.txt 2>&1
    net use >> x:\ghost\startlog.txt
    echo netUseEnd >> x:\ghost\startlog.txt

    x:
    cd \ghost
    rem --- This will create primary OS drive configuration ---
    ghost32.exe /setosdrives /blind >> x:\ghost\startlog.txt
    start ghost32.exe
    --- snip of start.bat ---
     
  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 outputs, open startlog.txt on command prompt.

    x:\ghost> notepad startlog.txt
     
  7. Backup startlog.txt to persistent storage before WinPE is shutting down if needed.
     
  8. Modify "net use" command or start.bat depending on system error
    on the page titled "Symantec Ghost Boot Wizard - Review" in the Ghost Boot Wizard.

    e.g.
    Check diskpart output in the startlog.txt and which drive is already used if the following error occurs, 
    then change drive name for "net use" command properly.

    System error 85 - The local device name is already in use.