SQL Agent error 7000 means Windows cannot find the file the SQL Server Agent service tries to run. This post comes from a DBA at one of my consulting engagements. After the operating system restarted, the SQL Server Agent service did not start. It was set to start automatically.

The Error
I looked for error messages and found this in the System event log:
Log Name: System
Source: Service Control Manager
Event ID: 7000
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Description:
The SQL Server Agent (MSSQLSERVER) service failed to start due to the following error:
The system cannot find the file specified.The message means that Windows tries to start the process (sqlagent.exe) and fails.
What the Client Saw
My client told me they had an issue with SQL Server Agent. After the restart, the service did not start, although they had set it to start automatically. When we tried to start it by hand, we got the same error that is in the event log:

How to Check
I opened the properties of the service and found that the Path to executable was invalid:

The picture also shows the startup type as Manual, although they believed it was automatic. Check that setting too.
The value was:
"F:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE" -i MSSQLSERVERWhy It Happens
For this client, all the binaries are on the C: drive. Ideally the path should have been:
"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE" -i MSSQLSERVERThe path pointed to a drive where the file does not exist, so the service could not find it. My client was not sure how it got changed.
The Fix
The path lives in the ImagePath value under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT. First identify the name of the service, shown as Service name in the properties. For a named instance of SQL Server, it is SQLAgent$InstanceName. Then change the ImagePath value to the correct path.

Confirm It Worked
After I changed ImagePath to the C: drive path, we were able to start the SQL Server Agent service, and the issue was resolved.
How to Prevent It
When a service fails like this after a restart, compare its path to the executable with where the files are.
Have you seen this error in your environment? Tell me in the comments what you did to solve it.

Error 7000 is not a missing program, it is a service pointing at the wrong address.
Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.
Discover more from SQL Authority with Pinal Dave
Subscribe to get the latest posts sent to your email.





8 Comments. Leave new
Thanks, this was helpful. Yes, it is happening for me. My situation is I have MS SQL installed on a separate vhdx (HyperV) virtual hard disk (not the C: drive which I have reserved for the 2019 OS). So, the path is right; however, on reboot I am still working to get the vhdx to mount automatically. The vhdx file is on the host rather than the VM. I think all will work if I can get the drive to attach (it works fine when I manually attach the drive).
I have a similar problem where after rebooting the SQL Server Service does not restart automatically even though it is set to. The error message is the same as in this article – event 7000 – “The system cannot find the file specified”. I can manually start the service though without changing anything. Does anyone have an idea why this would happen?
while my problem was wildly different (wrong drive letter after restore), your article triggered an “aha” moment to check on that. thank you !
What we eventually figured out was that SQL was trying to start before the iSCSI drives had become available. The solution was to make the SQL Server service dependent on the Microsoft iSCSI initiator service.
Thank you! This article gave a direction on where and what to check ,which ultimately cleared the problem.
Update: In my case the problem was a service needed to mount the drive was starting after SQL Server started. I had to add a dependency on the SQL service to ensure it started second.
check your sqlservr.exe file is not corrupted, if it is then try to start sql server from CMD C:Program FilesMicrosoft SQL ServerMSSQL12.MSSQLSERVERMSSQLBinnsqlservr.exe -s MSSQLEXPRESS, if this not able to launch SQL then replace sqlservr.exe and job DONE!!
From my side, this problem appears after an upgrade from SQL2012 to SQL2014. I followed your article and it solved my problem. Thanks a lot