9usdfu98ds

Disable automatic driver downloads.bat

Mar 23rd, 2022 (edited)
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. color 0E
  3. (NET FILE||(PowerShell -NoP -C "Start-Process -FilePath '%0' -Verb RunAs")&(NET FILE||exit)) >nul 2>&1
  4. for /F "tokens=3 delims=: " %%H in ('sc qc "DsmSvc" ^| find "START_TYPE"') do set start_type=%%H
  5. if "%start_type%"=="DISABLED" (
  6.     color 0C
  7.     echo Automatic driver downloads are DISABLED.
  8.     echo.
  9.     echo Press any key to enable . . .
  10.     pause >nul
  11.     sc config "DsmSvc" start= demand >nul
  12.     exit
  13. ) else (
  14.     color 0A
  15.     echo Automatic driver downloads are ENABLED.
  16.     echo.
  17.     echo Press any key to disable . . .
  18.     pause >nul
  19.     sc stop "DsmSvc" >nul 2>&1
  20.     sc config "DsmSvc" start= disabled >nul
  21.     exit
  22. )
  23. echo Error!
  24. pause
  25. exit
Add Comment
Please, Sign In to add comment