Advertisement
mesmariusz

quick_names_set

Dec 16th, 2017
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. @echo off
  2.  
  3. set user=%USERNAME%
  4.  
  5. call "%~dp0log" %~nx0: ==============================================
  6. call "%~dp0log" %~nx0: Konfiguracja nazw dla użytkownika: %user%
  7. call "%~dp0log" %~nx0: ==============================================
  8.  
  9. echo ==============================================
  10. echo Konfiguracja nazw dla użytkownika: %user%
  11. echo ==============================================
  12.  
  13.  
  14. SET /P PCNAME=Nazwa komputera:
  15. SET /P PCGROUP=Grupa robocza:
  16.  
  17. wmic computersystem where name="%computername%" call rename name="%PCNAME%" | find "ReturnValue = 0;"
  18. echo %errorlevel%
  19. if not errorlevel 1 ( call "%~dp0log" %~nx0: ustawiono nazwe komputera na: %PCNAME% )
  20. if errorlevel 1 ( call "%~dp0log" %~nx0: problem z ustawieniem nazwy komputera na: %PCNAME% )
  21.  
  22. reg add "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v SrvComment /t REG_SZ /d "%PCNAME%" >nul
  23. if not errorlevel 1 ( call "%~dp0log" %~nx0: ustawiono opis komputera na: %PCNAME% )
  24. if errorlevel 1 ( call "%~dp0log" %~nx0: problem z ustawieniem opisu komputera na: %PCNAME% )
  25. reg query "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /v SrvComment | find /i "SrvComment"| "%~dp0log" /fifo %~nx0: 2>nul
  26.  
  27. Wmic computersystem where name="%computername%" call joindomainorworkgroup name="%PCGROUP%" | find "ReturnValue = 0;"
  28. echo %errorlevel%
  29. if not errorlevel 1 ( call "%~dp0log" %~nx0: ustawiono grupe robocza na: %PCGROUP% )
  30. if errorlevel 1 ( call "%~dp0log" %~nx0: problem z ustawieniem grupy roboczej na: %PCGROUP% )
  31.  
  32. LABEL c: System
  33. if not errorlevel 1 ( call "%~dp0log" %~nx0: ustawiono nazwę dysku c: jako System )
  34. if errorlevel 1 ( call "%~dp0log" %~nx0: problem z ustawieniem nazwy dysku c: )
  35.  
  36. LABEL d: Dane
  37. if not errorlevel 1 ( call "%~dp0log" %~nx0: ustawiono nazwę dysku d: jako Dane )
  38. if errorlevel 1 ( call "%~dp0log" %~nx0: problem z ustawieniem nazwy dysku d: )
  39.  
  40. LABEL e: Dane
  41. if not errorlevel 1 ( call "%~dp0log" %~nx0: ustawiono nazwę dysku e: jako Dane )
  42. if errorlevel 1 ( call "%~dp0log" %~nx0: problem z ustawieniem nazwy dysku e: )
  43. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement