Turn off auto play of all partitions and resume CMD batch of auto play of all partitions

Time:2020-2-10

Using the method, create a new. TXT text document and paste the following code in the red area.

Then save to *. Bat suffix or *. CMD suffix batch file format to run!

1. Turn off auto play of all sections

Copy codeThe code is as follows:
@ ECHO OFF
@ ECHO.
@Echo. Special instructions
@ ECHO.
@ ECHO ——————————————————————————-
@Echo now has many kinds of viruses which are spread wantonly depending on the automatic play function of the USB flash disk. Sometimes we are too defenseless to think about
@Echo, the most popular vykin variant at present! This operation will completely turn off the autoplay function of all drives, please use it carefully!
@ ECHO ——————————————————————————-
@ ECHO.
echo. & pause
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoDriveTypeAutoRun /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoDriveTypeAutoRun /t REG_DWORD /d 255 /f
cls
echo.
echo.
echo.
echo.
Echo off all drives auto play successfully!
echo.
echo. & pause

2. Resume automatic play of all sections

Copy codeThe code is as follows:
@ ECHO OFF
@ ECHO.
@Echo. Special instructions
@ ECHO.
@ ECHO ——————————————————————————-
@It may be inconvenient for you to turn off the autoplay function of all drives of echo. This program can restore XP default
@Echo’s auto play function, but we remind you to do a good job of virus defense!
@ ECHO ——————————————————————————-
@ ECHO.
echo. & pause
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoDriveTypeAutoRun /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoDriveTypeAutoRun /t REG_DWORD /d 223 /f
cls
echo.
echo.
echo.
echo.
Echo restore all drives auto play successfully!
echo.
echo. & pause