Dave Farquhar has back-to-back posts on batch files.
Here’s an old, old, but still useful tip that works on all NT-based versions of Windows (including XP and 7). Longtime reader Jim couldn’t find it here anymore, and I can’t either, so I’ll repost it for posterity.
Open a command prompt, and issue these three commands:
net stop spooler
del /q c:\windows\system32\spool\printers\*
net start spooler
Sometimes in a batch file I find myself needing to perform more than one operation on a server, especially inside a for loop. Rather than do a pair of for loops, which isn’t always desirable, you can use the & operator.