SQLAGENT DOS Window stays open

When we run the Service SQLAGENT a DOS windows opens and stays open.
If we close it, the service stops.

Can anyone help?
LVL 16
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Partha MandayamTechnical DirectorCommented:
in enterprise manager, open the management node, right-click on sql server agent and choose Start.
Did a little research on it.  If you start the agent in a dos window, that dos session controls the agent.

sqlagent Application
The sqlagent application starts SQL Server Agent from the command prompt. Usually, SQL Server Agent should be run from SQL Server Service Manager or by using SQL-DMO methods in an application. Only run sqlagent from the command prompt when you are diagnosing SQL Server Agent, or when you are directed to by your primary support provider.

sqlagent -c [-v]

Indicates that SQL Server Agent is running from the command prompt and is independent of the Windows NT Service Control Manager. When -c is used, SQL Server Agent cannot be controlled from either the Services application in Control Panel or SQL Server Service Manager.
Indicates that SQL Server Agent runs in verbose mode and writes diagnostic information to the command-prompt window. The diagnostic information is the same as the information written to the SQL Server Agent error log.
After displaying a copyright message, sqlagent displays output in the command-prompt window only when the -v switch is specified. To stop sqlagent, press CTRL+C at the command prompt. Do not close the command-prompt window before stopping sqlagent.

mcp111 is correct.  OR you can start it via the services on the SQL server.

=)  Rob
Stop the SQL Agent.  Go into your Services menu and:

1. Double-click the SQLAgent service
2. Click on the Log On tab
3. Take the check mark off from "Allow service to interact with desktop"
4. Restart agent.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Not correct, do this:

1)Open up Notepad
2)Paste this in:

3) Save it as a batch file .bat extension

4) Double click or schedule it as a windows task to run.

Hope this helps...


glenn_1984Author Commented:
wyckedone1 -- "Interact with desktop" is already checked.
MichaelSFuller -- net start still leaves DOS box open
glenn_1984Author Commented:
Correction... wyckedone1 -- your answer WAS correct. Thanks
How? I do this everyday on a NAS, because of the UNC path problem, with SQL Server 2000.
MichaelSFuller: The way you described still starts the service which is controlled by the Services menu.  If you look at the service (in the Services menu), and it is set to interact with the desktop (i.e. step 3 in my answer), it will show the DOS window.  Removing that check mark does not allow the service to interact with the desktop.  Using the "net start" command is just a quicker way than going into the Services menu, right-clicking and choosing to start the service or starting the SQLAgent service using the Service Control Manager.
I misunderstood the question, from RDWaibel comments I thought they were trying to run the agent from a command prompt, and it was leaving the window open. For example when you do a nightly restart of SQL Server 2000, for cold snapshots on a NAS, or SAN or becasue of memory leaks on the server.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.