added homdrive mapper script

This commit is contained in:
Michael H.G. Schmidt 2024-07-01 22:54:34 +02:00
parent e9fba20c0b
commit 5c1e3646df

28
tools/maphome.cmd Normal file
View File

@ -0,0 +1,28 @@
@echo off
set PDC=192.168.6.1
set PDCNAME=GATEKEEPER
set BDC=192.168.89.1
set BDCNAME=KEYMASTER
set mydrive=H:
net use %mydrive% /DELETE
echo ####### %0 #######
for /f "tokens=2,* delims=:" %%A in ('ipconfig ^| find "Gateway"') do set GATEWAY=%%A
set GATEWAY=%GATEWAY:~1%
echo GATEWAY=%GATEWAY%
if /I %GATEWAY% == %PDC% (
echo using %PDCNAME% as HOMESERVER ...
net use %mydrive% \\%PDCNAME%\%USERNAME%
)
if /I %GATEWAY% == %BDC% (
echo using %BDCNAME% as HOMESERVER ...
net use %mydrive% \\%BDCNAME%\%USERNAME%
)
echo ####### %0 #######