Last active
September 21, 2016 01:56
-
-
Save brianfgonzalez/f8e53a934c530439656e734b725c7cf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FOR /F "tokens=1,2*" %%a in ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Control\Class"') DO call :FindAndReplace %%a | |
goto cleanup | |
:FindAndReplace | |
reg.exe query "%1\0000" /f "COM3" /d > nul | |
if "%ErrorLevel%"=="0" reg.exe add "%1\0000" /v "AttachedTo" /t REG_SZ /d "COM1" /f | |
exit /b | |
:cleanup | |
echo "Place your clean up code here" | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment