Advertisement
tolikpunkoff

all admin (hidden) shares disable

Sep 26th, 2018
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.25 KB | None | 0 0
  1. @echo off
  2. Setlocal EnableDelayedExpansion
  3.  
  4. for /F %%i In ('net share') do (
  5.  
  6.     set ITEM=%%i
  7.     call :check !ITEM!
  8.  
  9. )
  10.  
  11. goto :eof
  12.  
  13. :check
  14.  
  15.     set V1=%1
  16.     set V2=%V1:$=%
  17.  
  18.     if NOT %V1%==%V2% (
  19.         echo %V1%
  20.         net share %V1% /delete
  21.     )
  22.  
  23. :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement