Created
October 6, 2018 20:06
-
-
Save MarkTiedemann/0b289b95175e55323f764bc6294c0200 to your computer and use it in GitHub Desktop.
This file contains 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
@echo off | |
set log=C:\sys_init.log | |
:isAdmin | |
net sessions > nul 2>&1 | |
if %errorlevel% equ 0 goto stopDiskMonitor | |
:runAsAdmin | |
powershell ^ | |
-command "start-process cmd.exe -argumentList '/c %~dpnx0' -verb runAs" ^ | |
-windowStyle hidden | |
goto end | |
:stopDiskMonitor | |
echo %date% %time% > %log% | |
set /a i=0 | |
:loop | |
if %i% equ 30 goto stopSynapticsService | |
set /a i+=1 | |
ping 192.0.2.1 -n 1 -w 1000 > nul | |
taskkill /f /im DiskMonitor.exe >> %log% 2>&1 | |
if %errorlevel% neq 0 goto loop | |
:stopSynapticsService | |
net stop SynTPEnhService >> %log% 2>&1 | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment