Skip to content
⌘ NSIS Forum Archive

Verify SQL Server Agent is runnig

8 posts

iceman_k#
If you know the executable name, you can use the FindProc plugin to see if it is running. The FindProc plugin can be found on the NSIS Wiki.
Boyito#
Hi iceman
Ive download the plugin, copy FindProcDLL.dll in NSIS plugins directory and call the function with this syntax

FindProcDLL::FindProc "sqlagent.exe"
messagebox mb_ok 'SQL Agent Server Status $R0'

But $RO returns to me 0

But if i write
FindProcDLL::FindProc "sqlservr.exe"
$R0 returns 1

Both services are running, look in my attach image
Could yo help me?
fishweasel#
That image looks like a snippet of task manager. The SQL agent you are looking for is a service.

You can get the name from running services.msc or typing "net start" on a command line.

The service name you are looking for (if its part of MSDE) is "SQLSERVERAGENT"

i use a batch file to start my service (wether it is running or not) and then a reg entry to make it run automatically from then on :

Batch file :
net start "SQLSERVERAGENT"
Reg entry in [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT]
"Start"=dword:00000002 should set it to automatic.
Boyito#
HI fishweasel
Yes the image is part of the task manager
The service i want to detect is SQL SERVER AGENT and in this view is "sqlagent.exe".
I dont need to start o set it automatically only i need to detect the status of this particullary service
Boyito#
Ive found something

If i run the installer in W2003 still the problem, but if i run the same installer in W2000 works fine.
Maybe FindProcDLL::FindProc not work in w2003 environment??