From 5c1e3646df1a92bda307dc4184857644495a04f3 Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Mon, 1 Jul 2024 22:54:34 +0200 Subject: [PATCH] added homdrive mapper script --- tools/maphome.cmd | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tools/maphome.cmd diff --git a/tools/maphome.cmd b/tools/maphome.cmd new file mode 100644 index 0000000..a052dc1 --- /dev/null +++ b/tools/maphome.cmd @@ -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 ####### +