I'm using a script to map a network drive using the ideas that you suggest. The following batch script is on my path in a file called mount-computer.bat:
@echo off
rem # script to mount a computer on its stated drive
rem # have to use backup plan of a fixed IP mapping because of a known Windows bug with nameservers on a local network
rem # thus four arguments: drive directory host ip
set drive=%1
set directory=%~2
set host=%3
set ip=%4
net use %drive% "\%host%%directory%" /persistent:no
if not ERRORLEVEL 1 (
echo SUCCESS: %drive% connected to %host%
exit /B 0
)
net use L: "\%ip%%directory%" /persistent:no
if not ERRORLEVEL 1 (
echo SUCCESS: %drive% connected to %ip%
exit /B 0
)
echo ERROR: failed to connect
exit /B 1
Then I call this with appropriate parameters:
mount-computer L: Users LAPTOP 192.168.1.4
I have also configured my router to always give my laptop the same IP address.
This mounts \laptop\Users on drive L:, but if that fails, mounts \192.168.1.4\Users on drive L:. Either way I can then access my documents on drive L.