Powered by GeSHi

Source code for disabled.bat

(view source code of disabled.bat as plain text)

  1. @ECHO OFF
  2. ECHO.>CON
  3. ECHO DISABLED, Version 1.00 for Windows NT 4 >CON
  4. ECHO List all disabled user accounts >CON
  5. ECHO.>CON
  6. ECHO Written by Rob van der Woude >CON
  7. ECHO http://www.robvanderwoude.com >CON
  8. ECHO.>CON
  9. ECHO Gathering data, this may take several minutes . . .>CON
  10. ECHO.>CON
  11. ECHO Account is disabled for the following user IDs:
  12. ECHO.
  13.  
  14. FOR /F "skip=4 tokens=*" %%A IN ('NET USER /DOMAIN ^| FIND /V "The command completed successfully"') DO CALL :ParseUsers %%A
  15. GOTO:EOF
  16.  
  17. :ParseUsers
  18. FOR %%? IN (%*) DO CALL :ChkAcc %%?
  19. GOTO:EOF
  20.  
  21. :ChkAcc
  22. NET USER %1 /DOMAIN | FIND "Account active               Yes" >NUL
  23. IF ERRORLEVEL 1 ECHO.%1
  24. GOTO:EOF
  25.