Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- IF NOT %1=="" GOTO CHECKPARAM
- ECHO You did not mention an adapter for me to configure.
- ECHO Goodbye!
- GOTO :EOF
- :CHECKPARAM
- REM Make sure that other than setting the adapter name,
- REM you actually have a domain set.
- IF NOT %2=="" GOTO CONFIGDNS
- ECHO You did not supply a domain you want configured.
- ECHO Goodbye!
- GOTO :EOF
- :CONFIGDNS
- %WINDIR%\system32\wmic.exe nicconifg "where description='%~1'" call setdnsdomain("%~2")
- IF %ERRORLEVEL%==0 GOTO :EOF
- ECHO Uh-oh. WMIC seems to have not exited gracefully.
- ECHO The error code was %ERRORLEVEL%.
- ECHO Goodbye!
- :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement