:: In this example we restart the PCAnywhere service
:: The name of the service could be parametrize
:: PURPOSE TO CHECK IF THE PCANYWHERE SERVICE IS RUNNING
:: IF IT IS NOT RUNNING RESTART IT
@echo off & setlocal ENABLEEXTENSIONS
echo %errorlevel%
pause
call :IsRunning "pcAnywhere Host Service" && echo\yes || echo\no
if errorlevel 0 ENDLOCAL
echo kaikki ok
pause
goto :EOF
:EOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:IsRunning %svc%
::
:: By: Ritchie Lawrence, 2003-10-08. Version 1.0
::
:: Func: Sets errorlevel to zero if the specified service is running,
:: otherwise errorlevel set to one. For NT4/2000/XP/2003.
::
:: Args: %1 Display name of the service to check (by val)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal ENABLEEXTENSIONS & set "svc=%1"
set svc=%svc:"=%
echo The name of the service is %svc%
pause
net start | findstr/i /b /e /c:" %svc%" >nul
if errorlevel 1 call :RestartService %svc%
endlocal & goto :EOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:RestartService %svc%
setlocal ENABLEEXTENSIONS
echo The name of the service is %svc%
pause
echo Restarting the Service
pause
echo "%svc%"
pause
net start "%svc%"
pause
endlocal & goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
2 weeks ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!