Advertisement
FreeBooter

DisableAutoShare

Nov 14th, 2016
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.30 KB | None | 0 0
  1. :: Created by FreeBooter
  2. @Echo Off
  3. Title Dost-Tech.com
  4. Cd %systemroot%\system32
  5. Call :IsAdmin
  6.  
  7.  
  8.  
  9.  
  10. :_Start
  11. Cls & Mode CON  LINES=11 COLS=65 & Color 0D &Title Created By FreeBooter
  12. Echo.
  13. Echo       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  14. Echo       º Type (E) to Enable administrative shares  º  
  15. Echo       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  16. Echo.
  17. Echo.
  18. Echo       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»  
  19. Echo       º Type (D) to Disable administrative shares º  
  20. Echo       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ  
  21.  
  22.  
  23. Echo.
  24. Set /p input= RESPONSE:
  25. If /i  Not %input%==D (Goto :_Ex) Else (Goto :_Disable)
  26.  
  27. :_Ex
  28. If /i  Not %input%==E  (Goto :_Start) Else (Goto :_Enable)
  29.  
  30.  
  31.  
  32. :_Disable
  33. Reg Add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v AutoShareWks /t REG_DWORD /d 0  /f
  34.  
  35.  
  36.  
  37. Cls & Mode CON  LINES=5 COLS=48 & Color 0E
  38.  Echo.
  39.  Echo.
  40.  Echo                     FINNISH
  41.  
  42. Ping -n 5  localhost > Nul
  43.  
  44. Cls & Mode CON  LINES=11 COLS=42 & Color 0E & Title Dost-Tech.com
  45. Echo.
  46. Echo.
  47. Echo    THIS COMPUTER WILL REBOOT
  48. Echo.
  49. Echo.
  50. Echo    PLEASE SAVE ALL WORK IN PROGRESS
  51. Echo.
  52. Echo.
  53. Echo    PRESS 'ENTER' KEY TO RESTART COMPUTER
  54. Pause >Nul
  55.  
  56. Shutdown  -r  -t 0  -c "REBOOTING SYSTEM" 2>&1 > Nul
  57. Cls
  58. Exit
  59.  
  60.  
  61.  
  62.  
  63.  
  64. :_Enable
  65. Reg Add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v AutoShareWks /t REG_DWORD /d 1  /f
  66.  
  67. Cls & Mode CON  LINES=5 COLS=48 & Color 0E
  68.  Echo.
  69.  Echo.
  70.  Echo                     FINNISH
  71.  
  72. Ping -n 5  localhost > Nul
  73.  
  74.  
  75. Cls & Mode CON  LINES=11 COLS=42 & Color 0E & Title Dost-Tech.com
  76. Echo.
  77. Echo.
  78. Echo    THIS COMPUTER WILL REBOOT
  79. Echo.
  80. Echo.
  81. Echo    PLEASE SAVE ALL WORK IN PROGRESS
  82. Echo.
  83. Echo.
  84. Echo    PRESS 'ENTER' KEY TO RESTART COMPUTER
  85. Pause >Nul
  86.  
  87. Shutdown  -r  -t 0  -c "REBOOTING SYSTEM" 2>&1 > Nul
  88. Cls
  89. Exit
  90.  
  91.  
  92.  
  93.  
  94. :IsAdmin
  95. Reg query "HKU\S-1-5-19\Environment"
  96. If Not %ERRORLEVEL% EQU 0 (
  97.  Cls & Mode CON  LINES=5 COLS=48 & Color 0C & Title - WARNING -
  98.  Echo.
  99.  Echo.
  100.  Echo  YOU MUST HAVE ADMINISTRATOR RIGHTS TO CONTINUE
  101.  Pause > Nul & Exit
  102. )
  103. Cls
  104. goto:eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement