Skip to content

Instantly share code, notes, and snippets.

@allex
Last active December 14, 2015 11:29
Show Gist options
  • Save allex/5079514 to your computer and use it in GitHub Desktop.
Save allex/5079514 to your computer and use it in GitHub Desktop.
@echo off
REM =====================================
REM Auto mount host server user directory
REM By allex (allex.wxn@gmail.com)
REM =====================================
if exist Z:\ goto :eof
echo Connecting host server, please wait . . .
ping HOST -n 5 >nul
set host=HOST
set username=allex
set passwd=
set label=home
net use Z: \\%host%\%username% 123,qwe /user:%username% /p:no
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##%host%#%username%" /v _LabelFromReg /d "%label%" /f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment