I need to write a batch file to stop/start the print spooler and tcp/ip printing....

Can someone please help me with this, I need to write a batch file that stops and starts the print spooler....this is what i have so far:

net stop spooler
 del %systemroot%\system32\spool\printers\*.* /y
net start spooler

idealy, I would like to stop the print spooler, stop tcp/ip printing, then delete any files in the printers folder, then start the print spooler and tcp/ip printing....

Jason

LVL 3
jasonfarmerAsked:
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.

jasonfarmerAuthor Commented:
1 more thing...this is for a Win 2 K terminal server with citrix Metaframe Xp if that helps
0
brownmattcCommented:
Your really close.  Change the switches on the DEL command and your there:

net stop spooler
 del %systemroot%\system32\spool\printers\*.* /f/q
net start spooler

/f deletes the read only files as well
/q means it doesn't ask you just does it.

When you stop the spooler it also stoppes TCP/IP printing.

Let me know,

Matt
0

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
jasonfarmerAuthor Commented:
this is the answer i was looking for..... this one works great......


net stop "tcp/ip print server"
net stop spooler

 del %systemroot%\system32\spool\printers\*.* /y

net start spooler
net start "tcp/ip print server"
0
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
Windows 2000

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.