Jump to content

Recommended Posts

Posted

Every week at work, we have to print out a paper to keep track of our payment, and every week, we have to start the service 'Print Spooler' to be able to print it out.

As none of my co-workers have any clue about computers what so ever, I end up running around, fixing it for them.

I've tried making a simple script just to automate it, so everyone can do it, but it didn't work

My attempt:

run ("C:\Windows\System32\spoolsv.exe")

Could anyone please help me get this to work?

Posted

Simple search and you would've found a few example. Here's one >>

#RequireAdmin

ConsoleWrite(_ClearPrinterSpooler() & @CRLF)

Func _ClearPrinterSpooler() ; By rcmaehl
    RunWait(@ComSpec & ' /c ' & 'net stop spooler', @SystemDir, @SW_HIDE)
    If @error Then
        Return SetError(1, 0, 0)
    EndIf
    FileDelete(@SystemDir & "spoolprinters") ; Delete all files in the printer spool folder.
    Return RunWait(@ComSpec & ' /c ' & 'net start spooler', @SystemDir, @SW_HIDE)
EndFunc   ;==>_ClearPrinterSpooler

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Since the print spooler is a service, it operates alittle different and cannot be started the way you attempted. There are two commands that come to mind though that should do it.

Google "net start", "net stop" and "schtasks"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...