I am trying to figure out how to mount a sharing while the automatically network configuration process is happening during the boot-up process into the SRD recovery environment. I have tried putting net use j: \\server\shareName password /User:domain\user within each if block, and the disc continues to skip the share mounting process. Below is the AutoNetwork.cmd script (found in the BOOT.WIM file, in Windows\Shell\AutoNetwork.cmd), and the changes that I have made (the net use command snippet):
@echo off
:AutoNetwork
call %ShellPath%\FindDrive.cmd ?:\VProRecovery\VProRecovery.net FoundDrive
if not "%FoundDrive%" == "" (
%SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\VProRecovery\VProRecovery.net -preferdhcp
net use j: \\server\shareName password /User:domain\user
exit 0
)
call %ShellPath%\FindDrive.cmd ?:\VProRecovery\AutoNetwork.xml FoundDrive
if not "%FoundDrive%" == "" (
%SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\VProRecovery\AutoNetwork.xml
net use j: \\server\shareName password /User:domain\user
exit 0
)
call %ShellPath%\FindDrive.cmd ?:\VProRecovery\AutoRestore.xml FoundDrive
if not "%FoundDrive%" == "" (
%SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\VProRecovery\AutoRestore.xml
net use j: \\server\shareName password /User:domain\user
exit 0
)
REM Look for AutoNetwork.xml file at Srd root
call FindDrive.cmd ?:\AutoNetwork.xml FoundDrive
if not "%FoundDrive%" == "" (
%SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\AutoNetwork.xml
net use j: \\server\shareName password /User:domain\user
exit 0
)
REM Look for AutoNetwork.xml file in Srd Shell location (where FindDrive.cmd is run)
call FindDrive.cmd ?:AutoNetwork.xml FoundDrive
if not "%FoundDrive%" == "" (
%SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:AutoNetwork.xml
net use j: \\server\shareName password /User:domain\user
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
if not "%FoundDrive%" == "" (
%SystemRoot%\System32\RunDll32.exe %ShellPath%\SreNet.dll,Execute -start -auto %FoundDrive%:\Srd\AutoNetwork.xml
net use j: \\server\shareName password /User:domain\user
exit 0
)
net use j: \\server\shareName password /User:domain\user
exit 0
-----------------------------------------------------------------------------------------------------------------------------
But this does not work. I still have to manually connect to the share each time. Where is the best place to put the net use command within the file AutoNetwork.cmd? Or, is there a way to process custom commands to run after SRD has fully loaded up the GUI?
In addition, how can I tell SRD to automatically accept the EULA?