Skip to content Skip to main navigation Skip to footer

Automatically Map Network Drive in TBWinPE/RE

This article provides instructions to automatically map a network drive in TBWinPE/RE. This is useful when connecting to the share is always (or often) needed and you don't wish to map it manually after booting. While there are several methods that can be used to accomplish this task, using InitScript is usually the simplest and is available both in TBWinPE/RE Builder and the TBWinPE.cmd/TBWinRE.cmd scripts.

Using TBWinPE/RE Builder

  1. Run TBWinPE/RE Builder.
  2. Go into Settings and click the Scripts tab.
  3. Check the Include InitScript.cmd option and then click the Edit link. The script will open in Notepad.
  4. Add the command to the end of the file to map the network drive. Examples:
    net use y: \\Server\share password /user:username
    net use y: \\OfficeServer\Backups pswd123 /user:John


    If you need to test out a command to verify it works properly you can boot into TBWinPE/RE and run it directly from a Command Prompt. For more usage information and examples, run net use /? from a Command Prompt.
    Alternatively, if you only wish to log into the network share and not map a drive letter to it, you can use Image for Windows with the /login parameter (the command would all be on one line):
    "X:\Program Files\TeraByte Drive Image Backup and Restore Suite\imagew.exe" /log:0 /hide /login:\\OfficeServer\Backups*John*pswd123 /quit

    Note: Image for Windows stored passwords can't be used in TBWinPE/RE as they are only available for the applicable user when booted into Windows.
  5. Save the file and exit Notepad when finished.
  6. Back in TBWinPE/RE Builder Settings, click the TBLauncher tab.
  7. Make sure the Run network initialization option is checked.
  8. Make sure the Run initialization programs in background option is unchecked (this is necessary so that network initialization can complete prior to InitScript.cmd being run).
  9. Click OK to close Settings.
  10. Continue creating the TBWinPE/RE build.

Using the TBWinPE.cmd or TBWinRE.cmd Scripts

  1. Create a text file named InitScript.cmd in the build's folder.
  2. Open InitScript.cmd in Notepad.
  3. Add the command to map the network drive (or log into the network share) as shown in Step 4 of the previous section.
  4. Save the file and close Notepad.
  5. Open TBLauncher.ini in Notepad.
  6. Set the RunNetworkInit variable to 1:
    RunNetworkInit=1
  7. Set the BackgroundInit variable to 0:
    BackgroundInit=0
  8. Save the file and close Notepad.
  9. Run TBWinPE.cmd/TBWinRE.cmd to create the build.

Was This Article Helpful?

0