{"id":643,"date":"2020-02-01T05:51:00","date_gmt":"2020-02-01T13:51:00","guid":{"rendered":"https:\/\/kb.terabyteunlimited.com\/kb-articles\/automatically-map-network-drive-in-tbwinpe-re\/"},"modified":"2021-09-07T15:05:15","modified_gmt":"2021-09-07T22:05:15","slug":"automatically-map-network-drive-in-tbwinpe-re","status":"publish","type":"lsvr_kba","link":"https:\/\/www.terabyteunlimited.com\/kb\/kb-articles\/automatically-map-network-drive-in-tbwinpe-re\/","title":{"rendered":"Automatically Map Network Drive in TBWinPE\/RE"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: #005858;\"><strong>Using TBWinPE\/RE Builder<\/strong><\/span><\/p>\n\n\n<ol style=\"list-style-position: outside;\">\n<li>Run TBWinPE\/RE Builder.<\/li>\n<li>Go into Settings and click the <strong>Scripts<\/strong> tab.<\/li>\n<li>Check the <strong>Include InitScript.cmd<\/strong> option and then click the <strong>Edit<\/strong> link. The script will open in Notepad.<\/li>\n<li>Add the command to the end of the file to map the network drive. Examples:<br \/><span style=\"color: #008800; font-family: Courier New, Courier, monospace;\"><strong>net use y: &#92;&#92;Server&#92;share password \/user:username<br \/>net use y: &#92;&#92;OfficeServer&#92;Backups pswd123 \/user:John<\/strong><\/span><br \/><br \/>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 <span style=\"color: #008800; font-family: Courier New, Courier, monospace;\"><strong>net use \/?<\/strong><\/span> from a Command Prompt.<br \/>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 <span style=\"color: #008800; font-family: Courier New, Courier, monospace;\"><strong>\/login<\/strong><\/span> parameter (the command would all be on one line):<br \/><span style=\"color: #008800; font-family: Courier New, Courier, monospace;\"><strong>\"X:&#92;Program Files&#92;TeraByte Drive Image Backup and Restore Suite&#92;imagew.exe\" \/log:0 \/hide \/login:&#92;&#92;OfficeServer&#92;Backups*John*pswd123 \/quit<\/strong><\/span><br \/><br \/>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.<\/li>\n<li>Save the file and exit Notepad when finished.<\/li>\n<li>Back in TBWinPE\/RE Builder Settings, click the <strong>TBLauncher<\/strong> tab.<\/li>\n<li>Make sure the <strong>Run network initialization<\/strong> option is checked.<\/li>\n<li>Make sure the <strong>Run initialization programs in background <\/strong>option is unchecked (this is necessary so that network initialization can complete prior to InitScript.cmd being run).<\/li>\n<li>Click <strong>OK<\/strong> to close Settings.<\/li>\n<li>Continue creating the TBWinPE\/RE build.<\/li>\n<\/ol>\n\n\n<p class=\"wp-block-paragraph\"><span style=\"color: #005858;\"><strong>Using the TBWinPE.cmd or TBWinRE.cmd Scripts<\/strong><\/span><\/p>\n\n\n<ol style=\"list-style-position: outside;\">\n<li>Create a text file named <strong>InitScript.cmd<\/strong> in the build's folder.<\/li>\n<li>Open <strong>InitScript.cmd<\/strong> in Notepad.<\/li>\n<li>Add the command to map the network drive (or log into the network share) as shown in Step 4 of the previous section.<\/li>\n<li>Save the file and close Notepad.<\/li>\n<li>Open <strong>TBLauncher.ini<\/strong> in Notepad.<\/li>\n<li>Set the <strong>RunNetworkInit<\/strong> variable to 1:<br \/><span style=\"color: #008800; font-family: Courier New, Courier, monospace;\"><strong>RunNetworkInit=1<\/strong><\/span><\/li>\n<li>Set the <strong>BackgroundInit<\/strong> variable to 0:<br \/><span style=\"color: #008800; font-family: Courier New, Courier, monospace;\"><strong>BackgroundInit=0<\/strong><\/span><\/li>\n<li>Save the file and close Notepad.<\/li>\n<li>Run TBWinPE.cmd\/TBWinRE.cmd to create the build.<\/li>\n<\/ol>","protected":false},"excerpt":{"rendered":"<p>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&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"lsvr_kba_cat":[1796],"lsvr_kba_tag":[2121],"class_list":["post-643","lsvr_kba","type-lsvr_kba","status-publish","hentry","lsvr_kba_cat-general-information-image-for-windows","lsvr_kba_tag-image-for-windows"],"_links":{"self":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/comments?post=643"}],"version-history":[{"count":1,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/643\/revisions"}],"predecessor-version":[{"id":6349,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/643\/revisions\/6349"}],"wp:attachment":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/media?parent=643"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_cat?post=643"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_tag?post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}