Created
August 9, 2017 07:30
-
-
Save albertofwb/e9c561ed09897e2eebe88617dc6597c3 to your computer and use it in GitHub Desktop.
put this script in "C:\windows\system32" then you can simply type "restart AppName" to restart windows softwares
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 App=%1 | |
set SleepSeconds=2 | |
set PingIP=127.0.0.1 | |
if "%App%" == "" ( | |
goto usage | |
) | |
if "%App:~-3%" neq "exe" ( | |
set App=%App%.exe | |
) | |
taskkill /f /im %App% >nul | |
if errorlevel 1 goto invalid | |
ping -n %SleepSeconds% %PingIP% >nul | |
start %App% | |
goto done | |
:usage | |
echo %0 AppName | |
goto done | |
:invalid | |
echo can't find %App% | |
goto done | |
:done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment