cancel
Showing results for 
Search instead for 
Did you mean: 

How to automatically map a network drive within Symantec Recovery Disk

MaximeDucharme
Level 3
Hello, I've been looking everywhere but this information is nowhere to be found. All of our images are located on the same network storage, and I would like to automatically map a network drive to that location during SRD bootup sequence...

Any though or tips would be greatly appreciated

11 REPLIES 11

Markus_Koestler
Moderator
Moderator
   VIP   
You have to create a custom SRD disk and add the net use command to for example the Windows\Shell\AutoNetwork.cmd  file. This should map the drive right after the network is started. To edit this file you have to mount the SOURCES\BOOT.WIM file of the SRD using imagex. I have a more detailed description, unfortunatly in german, so in case you need more details I would have to translate it.

MaximeDucharme
Level 3
Thank you very much!!
I'll try to find my way and will let you know if I'm stuck somewhere.

MaximeDucharme
Level 3
Hi again, I managed to extract the autonetwork.cmd and added the net use command. The only problem I have now is that I don't know how to append the new file into the boot.wim.

Is it possible for you to give me the exact command line I need to use within imagex to do so??

MaximeDucharme
Level 3

Markus_Koestler
Moderator
Moderator
   VIP   

So I assue you mounted the boot.wim from the SRD CD to a directory. After that you changed to that directory and edited the autonetwork.cmd in the \windows\shell subdirectory. To apply the edited autonetwork.cmd to the WIM image just type: imagex.exe /umount PATHWHEREYOUMOUNTEDTHEIMAGE /commit.


MaximeDucharme
Level 3

Allright, I managed to edit the autonetwork.cmd with the net use command and updated the Boot.wim. I copied the modified Boot.wim on my booting media. Unfortunately the network drive maps never occur while booting.

I have inserted the net use command as shown below:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@echo off


:AutoNetwork

        call %ShellPath%\FindDrive.cmd ?:\VProRecovery\VProRecovery.net FoundDrive
net use z: \\server\share password /user:domain\user
        if not "%FoundDrive%" == "" (
            %SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\VProRecovery\VProRecovery.net -preferdhcp
            exit 0
        )
        
        call %ShellPath%\FindDrive.cmd ?:\VProRecovery\AutoNetwork.xml FoundDrive
net use z: \\server\share password /user:domain\user
        if not "%FoundDrive%" == "" (
            %SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\VProRecovery\AutoNetwork.xml
            exit 0
        )
        
        call %ShellPath%\FindDrive.cmd ?:\VProRecovery\AutoRestore.xml FoundDrive
net use z: \\server\share password /user:domain\user
        if not "%FoundDrive%" == "" (
            %SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\VProRecovery\AutoRestore.xml
            exit 0
        )

        REM Look for AutoNetwork.xml file at Srd root
        call FindDrive.cmd ?:\AutoNetwork.xml FoundDrive
net use z: \\server\share password /user:domain\user
        if not "%FoundDrive%" == "" (
            %SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\AutoNetwork.xml
            exit 0
        )
        
        REM Look for AutoNetwork.xml file in Srd Shell location (where FindDrive.cmd is run)
        call FindDrive.cmd ?:AutoNetwork.xml FoundDrive
net use z: \\server\share password /user:domain\user
        if not "%FoundDrive%" == "" (
            %SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:AutoNetwork.xml
            exit 0
        )
    
    REM If above files are not found in any of drives then look AutoNetwork.xml in Srd folder
    call %ShellPath%\FindDrive.cmd ?:\Srd\AutoNetwork.xml FoundDrive
net use z: \\server\share password /user:domain\user
    if not "%FoundDrive%" == "" (
        %SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\Srd\AutoNetwork.xml
            exit 0
        )
    
    net use z: \\server\share password /user:domain\user
    exit 0

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Now maybe I do not understand how this script works, I've inserted my line everywhere the loop could possibly go to my understanding. Also I tryed the script in windows and the drive maps succesfully. But when I insert it into the WinPe environnment everything boots succesfully but the Network maps just never happens. I've tryed a separate script that runs the Net use command manually with the command line and the network drive maps succesfully. It appears that the script is somehow skipping the net use command I added...

Markus_Koestler
Moderator
Moderator
   VIP   

Maybe you want to map the drive before the network is started ?! I assue the line

"%SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:AutoNetwork.xml"

is actually starting the network stack, so you might try to insert your net use command AFTER this lines but BEFORE the exit 0

Markus_Koestler
Moderator
Moderator
   VIP   

Have you had a chance to try ?

Markus_Koestler
Moderator
Moderator
   VIP   

Any updates here ?

Markus_Koestler
Moderator
Moderator
   VIP   

Any updates here ?

Markus_Koestler
Moderator
Moderator
   VIP   

Now I've finally figured out how to do it. Are you still interestet ?