Advertisement
Guest User

Untitled

a guest
Jan 20th, 2011
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. @ECHO OFF
  2.  
  3. IF NOT %1=="" GOTO CHECKPARAM
  4.  
  5. ECHO You did not mention an adapter for me to configure.
  6. ECHO Goodbye!
  7. GOTO :EOF
  8.  
  9. :CHECKPARAM
  10.  
  11. REM Make sure that other than setting the adapter name,
  12. REM you actually have a domain set.
  13.  
  14. IF NOT %2=="" GOTO CONFIGDNS
  15.  
  16. ECHO You did not supply a domain you want configured.
  17. ECHO Goodbye!
  18. GOTO :EOF
  19.  
  20. :CONFIGDNS
  21.  
  22. %WINDIR%\system32\wmic.exe nicconifg "where description='%~1'" call setdnsdomain("%~2")
  23.  
  24. IF %ERRORLEVEL%==0 GOTO :EOF
  25.  
  26. ECHO Uh-oh. WMIC seems to have not exited gracefully.
  27. ECHO The error code was %ERRORLEVEL%.
  28. ECHO Goodbye!
  29.  
  30. :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement