I\'m working on a monitoring system called \"Nagios\" which monitors services for UNIX and WINDOWS servers. Problem is WINDOWS services that are launched by batch files are
You can do this with following batch
echo off
set program=c:\Windows\system32\cmd.exe
set alias_name=%1
set alias_path=%~dp0
set batch_file=%2
set alias=%alias_path%%alias_name%.exe
call :find_args %*
call :make_link %program% %alias%
%alias% /C %batch_file% %args%
:find_args
set args=
shift
shift
:loop
if [%1] == [] goto :eof
set args=%args% %1
shift
goto :loop
:make_link
copy %1 %2
HOW TO USE
Rename-cmd.bat NAME_OF_CMD_IN_TSKMGR BATCH_YOU_WANT_TO_START