Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

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

0
jasonfarmer
Asked:
jasonfarmer
  • 2
1 Solution
 
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
 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now