1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
@echo off
cls
title Run and Close Skype
echo ==================================================================
echo [1] Run Skype
echo [2] Close Skype
echo [3] Skype Status (is it running?)
echo ==================================================================
:Option
SET /P INPUT="Choose an option:"
IF /I '%INPUT%'=='1' GOTO Run
IF /I '%INPUT%'=='2' GOTO Close
IF /I '%INPUT%'=='3' GOTO Status
IF /I '%INPUT%'=='Q' GOTO Quit
:Run
echo.
echo Launching Skype... Please wait few seconds.
start "" /b /min /LOW Skype.exe
ping 192.0.2.2 -n 1 -w 5000>nul 2>nul
tasklist /FI "IMAGENAME eq Skype.exe" 2>NUL | find /I /N "Skype.exe">NUL
if "%ERRORLEVEL%"=="0" echo Skype is running.
if "%ERRORLEVEL%"=="1" echo Skype is not running.
echo.
GOTO Option
:Close
echo.
echo Closing Skype... Please wait few seconds.
taskkill /f /im Skype.exe>NUL
ping 192.0.2.2 -n 1 -w 2000>nul 2>nul
tasklist /FI "IMAGENAME eq Skype.exe" 2>NUL | find /I /N "Skype.exe">NUL
::If Skype if closed, status is running... problem?
if "%ERRORLEVEL%"=="0" echo Skype is running.
if "%ERRORLEVEL%"=="1" echo Skype is not running.
echo.
GOTO Option
:Status
echo.
echo Checking Skype status... Please wait few seconds.
ping 192.0.2.2 -n 1 -w 1000>nul 2>nul
tasklist /FI "IMAGENAME eq Skype.exe" 2>NUL | find /I /N "Skype.exe">NUL
if "%ERRORLEVEL%"=="0" echo Skype is running.
if "%ERRORLEVEL%"=="1" echo Skype is is not running.
echo.
GOTO Option
:Quit
EXIT |
Partager