New
#1
Mapping OneDrive: Could Not Reconnect to All Network Drives
I've mapped OneDrive to use it as a backup storage per instruction here, but I get the said error every time I reboot. So I wrote a simple batch script to remap automatically when I logon to Windows.
Usage: MapOneDrive.cmd [Number of checks] "[IPv4 to ping]" "[Drive letter]" "[OneDrive CID]" "[Username]" "[Password]"
Example: MapOneDrive.cmd 60 "8.8.8.8" "Z" "123456789" "bulldog@live.net" "pwd123"
The value "60" is the number of pings -- once per loop. A single loop is a little over a second.
Save the following as "MapOneDrive.cmd". Create a shortcut to it with all the necessary information therein, then put it in the startup folder.
Hope you'll find it useful! :)Code:@ECHO OFF GOTO START :HELP ECHO. ECHO Usage: MapOneDrive.cmd [Number of checks] "[IP to ping]" "[Drive letter]" "[OneDrive CID]" "[Username]" "[Password]" ECHO. PAUSE GOTO END :START IF "%~1" == "/?" GOTO HELP IF "%~6" == "" ( ECHO Something is missing! GOTO HELP ) SETLOCAL SET count=0 SET loop=%1 :PING TIMEOUT /T 1 >nul SET /A count=count+1 PING -4 -n 1 %2 | find "Reply from" >nul GOTO CHECK :CHECK IF NOT ERRORLEVEL 1 ( GOTO MAP ) ELSE ( IF %count% LSS %loop% ( GOTO PING ) ELSE ( GOTO END ) ) :MAP ECHO Mapping drive %3 in progress... NET USE %3: "https://d.docs.live.net/%4" /user:%5 %6 /persistent:yes GOTO END :END ENDLOCAL
Last edited by Taurean75; 12 Sep 2015 at 12:25.