• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Script to restart print spooler

Joined
Nov 30, 2008
Messages
555 (0.09/day)
Location
Birmingham, England...
Processor Intel Core 2 Quad Q6600 @ 2.8GHz
Motherboard Gigabyte X48T-DQ6
Cooling Zalman 9500 LED CPU Cooler
Memory 2x 2GB Corsair DDR3 XMS3 DHX - 1600MH/PC3-12800
Video Card(s) Gigabyte HD4870 1GB
Storage 2x Seagate 320GB Barracuda (RAID 0) 3x 1TB Samsung F3, 140GB WD Maxtor (10,000rpm)
Display(s) 2x 20" LG Flatron L204WS
Power Supply Powercool 850W
Software Windows 7 Ultimate x64
Hi

I'm trying to get a script to restart the print spooler on a server from a slient so I don't have to remote in and restart it manually each time. Is this possible?

I have the restart code, just need to point it to a server.

Code:
@echo off
net stop spooler
net start spooler
exit

Any ideas?

Thanks
 

Kreij

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (2.08/day)
Location
Cheeseland (Wisconsin, USA)
sc \\computer stop "service name"
sc \\computer start "service name"

sc.exe is in the system32 and/or SysWOW64 folders.
 
Joined
Nov 30, 2008
Messages
555 (0.09/day)
Location
Birmingham, England...
Processor Intel Core 2 Quad Q6600 @ 2.8GHz
Motherboard Gigabyte X48T-DQ6
Cooling Zalman 9500 LED CPU Cooler
Memory 2x 2GB Corsair DDR3 XMS3 DHX - 1600MH/PC3-12800
Video Card(s) Gigabyte HD4870 1GB
Storage 2x Seagate 320GB Barracuda (RAID 0) 3x 1TB Samsung F3, 140GB WD Maxtor (10,000rpm)
Display(s) 2x 20" LG Flatron L204WS
Power Supply Powercool 850W
Software Windows 7 Ultimate x64
Thanks both...

Kreij, your reply worked perfectly as always!! Thanks!
 
Top