Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo Checking network connectivity to the network.
- ping -n 5 192.168.1.1 >nul
- if "!errorlevel!" EQU "0" (
- echo Unable to find an internet connection. Please see your Systems Administrator for assistance.
- goto:Exit
- else (
- goto:CheckDrive
- )
- )
- :CheckDrive
- if exist SETDRIVELETTER (
- echo You already have access to the network drive. Opening drive.
- %SystemRoot%\explorer.exe "SETDRIVELETTER"
- goto:Exit
- else (
- echo The network drive was not found. Attempting to reconnect.
- net use SETDRIVELETTER \\NETWORKDRIVELOCATION\FOLDER\ /USER:USERNAME PASSWORD /p:yes
- echo You should now have access to the network drive. Attempting to open drive.
- %SystemRoot%\explorer.exe "\\NETWORKDRIVELOCATION\FOLDER"
- goto:Exit
- )
- )
- :Exit
- Pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement