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

Script to restart print spooler

Discussion in 'Programming & Webmastering' started by Akumos, Jan 7, 2011.

  1. Akumos

    Akumos

    Joined:
    Nov 30, 2008
    Messages:
    535 (0.26/day)
    Thanks Received:
    27
    Location:
    Birmingham, England...
    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
  2. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.08/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    sc \\computer stop "service name"
    sc \\computer start "service name"

    sc.exe is in the system32 and/or SysWOW64 folders.
    Akumos says thanks.
  3. ktr

    ktr

    Joined:
    Apr 7, 2006
    Messages:
    7,407 (2.44/day)
    Thanks Received:
    687
  4. Akumos

    Akumos

    Joined:
    Nov 30, 2008
    Messages:
    535 (0.26/day)
    Thanks Received:
    27
    Location:
    Birmingham, England...
    Thanks both...

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

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page