Hello There, Guest!
View New Posts  |  View Today's Posts
[Release] Print Spooler Utility

  • 0 Vote(s) - 0 Average


03-26-2013, 10:49 AM #1
euverve
Member
**
Posts: 124 Threads:55 Joined: Dec 2011 Reputation: 6

Print Spooler Utility
Are you tired in doing the manual way of stop/restart "Print Spooler" service?
Ahhmm, you better try this simple utility.



Download:
Code:
http://www.mediafire.com/download.php?pba7ktpavq4wsf1

Greetz
USB Anti-virus? Try USB Drive Defender

03-26-2013, 03:19 PM #2
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Print Spooler Utility
There's already a service utility included with Windows. Thus a batch script would be more useful than a dedicated app in my opinion.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

03-26-2013, 08:40 PM #3
euverve
Member
**
Posts: 124 Threads:55 Joined: Dec 2011 Reputation: 6

RE: Print Spooler Utility
(03-26-2013, 03:19 PM)AceInfinity Wrote:  There's already a service utility included with Windows. Thus a batch script would be more useful than a dedicated app in my opinion.

This can be done easily with batch.

Some things I consider is the status of service and removing print jobs or ques. It throws an error when starting the service that is been already started and stopping it when already stopped. And removing print jobs that are currently locked by the printer status monitor (EPSON Stylus Printer)... that is why I utilize the unlocker to unlock those files and continue removing those print jobs.
This post was last modified: 03-26-2013, 09:49 PM by euverve.
USB Anti-virus? Try USB Drive Defender

03-26-2013, 11:33 PM #4
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Print Spooler Utility
(03-26-2013, 08:40 PM)euverve Wrote:  
(03-26-2013, 03:19 PM)AceInfinity Wrote:  There's already a service utility included with Windows. Thus a batch script would be more useful than a dedicated app in my opinion.

This can be done easily with batch.

Some things I consider is the status of service and removing print jobs or ques. It throws an error when starting the service that is been already started and stopping it when already stopped. And removing print jobs that are currently locked by the printer status monitor (EPSON Stylus Printer)... that is why I utilize the unlocker to unlock those files and continue removing those print jobs.

I know, that's why I suggested it though, and the filesize of the batch script would be smaller than the compiled executable.

Quote:It throws an error when starting the service that is been already started and stopping it when already stopped.

This can all be done with batch through an executable already designed to do this kind of stuff on Windows.

Quote:that is why I utilize the unlocker to unlock those files and continue removing those print jobs.

Unlocker? You didn't add that utility as a resource I hope.

edit: Just checked, but still, If you're going to depend on Unlocker, then what can this program do that a batch script cannot? was my point...

Batch was intended to be used for things like this, automating simple tasks, and in this case all the functionality already exists within Windows executables.
This post was last modified: 03-26-2013, 11:35 PM by AceInfinity.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

03-26-2013, 11:53 PM #5
euverve
Member
**
Posts: 124 Threads:55 Joined: Dec 2011 Reputation: 6

RE: Print Spooler Utility
This is the reason why I add the unlocker.



I stop the service before removing print jobs/ques.
This post was last modified: 03-26-2013, 11:59 PM by euverve.
USB Anti-virus? Try USB Drive Defender

03-27-2013, 12:04 AM #6
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Print Spooler Utility
What are you doing to stop the service?


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

03-27-2013, 12:11 AM #7
euverve
Member
**
Posts: 124 Threads:55 Joined: Dec 2011 Reputation: 6

RE: Print Spooler Utility
Code:
 Private PrintService As ServiceController = New ServiceController("Spooler")
 With PrintService
                If Not .Status.Equals(ServiceControllerStatus.Stopped) Then
                    bgw_StopService.ReportProgress(0)
                    ' Stop the service if its status is not set to "Stopped".
                    .Stop()

                    ' Stop the service, and wait until its status is "Running".
                    .WaitForStatus(ServiceControllerStatus.Stopped)
                End If
            End With


Code:
Private Sub GetPrinterStatus()
        Dim PrintStatus = PrintService.Status.ToString
        Label_Status.Text = PrintStatus
        ToolStripStatusLabel_Status.Text = "Ready"

        'Refresh service info
        PrintService.Refresh()

        'Set buttons state
        If PrintStatus = "Running" Then
            Label_Status.ForeColor = Color.Green
            Button_Stop.Enabled = True
            Button_Start.Enabled = False
            Button_RemovePrintJobs.Enabled = False
        ElseIf PrintStatus = "Stopped" Then
            Label_Status.ForeColor = Color.Red
            Button_Stop.Enabled = False
            Button_Start.Enabled = True
            Button_RemovePrintJobs.Enabled = True
        End If
    End Sub
USB Anti-virus? Try USB Drive Defender

03-27-2013, 12:23 AM #8
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Print Spooler Utility
Where is the Unlocker in here? There must be better ways than using Unlocker here because I think that's a bit forceful here. And not always is that a good thing. I haven't fooled around with any of this though because my printer software already allows me to do most of this stuff.

There is a CanStop property though that I think you should pay attention to as well for this. http://msdn.microsoft.com/en-us/library/...nstop.aspx

Other than that, I don't really know what else to say.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

03-27-2013, 12:33 AM #9
euverve
Member
**
Posts: 124 Threads:55 Joined: Dec 2011 Reputation: 6

RE: Print Spooler Utility
(03-27-2013, 12:23 AM)AceInfinity Wrote:  Where is the Unlocker in here? There must be better ways than using Unlocker here because I think that's a bit forceful here. And not always is that a good thing. I haven't fooled around with any of this though because my printer software already allows me to do most of this stuff.

There is a CanStop property though that I think you should pay attention to as well for this. http://msdn.microsoft.com/en-us/library/...nstop.aspx

Other than that, I don't really know what else to say.

I pasted it here:
Code:
http://pastebin.com/KA7LmYmu

Project Source:
Code:
http://www.mediafire.com/?qaacsf9qk9abyco
This post was last modified: 03-27-2013, 12:35 AM by euverve.
USB Anti-virus? Try USB Drive Defender




Forum Jump:



Users browsing this thread: 1 Guest(s)