Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for /f "usebackq tokens=2" %%f in (`netsh int ipv4 show ipaddress "Local area connection" ^| findstr /c:"Parameters"`) do SET ADDR=%%f
- for /f "tokens=3 delims=." %%a in ("%ADDR%") do set START_ADDR=%%a
- for /f "tokens=4 delims=." %%a in ("%ADDR%") do set END_ADDR=%%a
- echo %START_ADDR%.%END_ADDR%
- set /a x=%START_ADDR%-1
- set /a xx=%START_ADDR%-1
- IF %END_ADDR% EQU 10 x=%START_ADDR%
- if /i "%computername%" == "node0%x%%END_ADDR%" goto :cond
- if /i "%computername%" == "node%x%%END_ADDR%" goto :cond
- for /f "usebackq tokens=8" %%f in (`netsh int ipv4 show interfaces ^| findstr /c:"4092"`) do SET ADDR=%%f
- netsh interface ip set address name="Local area connection %ADDR%" static 10.12.%START_ADDR%.%END_ADDR% 255.255.0.0
- IF %xx% LSS 10 (WMIC computersystem where caption="%computername%" rename "node0%x%%END_ADDR%") ELSE (WMIC computersystem where caption="%computername%" rename "node%x%%END_ADDR%")
- shutdown -r -f -t 30
- exit
- :cond
- echo "normal node"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement