bunch of fixes and updates
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
## Stop the spooler service
|
||||
Control-Service -Stop -Name 'spooler'
|
||||
$SERVICE = 'spooler'
|
||||
|
||||
## Delete all print jobs
|
||||
LogMsg "Deleting all print jobs from ""${Env:WINDIR}\System32\spool\PRINTERS"""
|
||||
Try { Remove-Item "${Env:WINDIR}\System32\spool\PRINTERS\*" -Recurse }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
## Make sure the service isn't disabled
|
||||
If (! ($(Get-Service -Name 'spooler').StartType -eq "Disabled") ) {
|
||||
|
||||
## Start the spooler service
|
||||
Control-Service -Start -Name 'spooler'
|
||||
## Stop the spooler service
|
||||
Control-Service -Stop -Name $SERVICE
|
||||
|
||||
## Delete all print jobs
|
||||
LogMsg "Deleting all print jobs from ""${Env:WINDIR}\System32\spool\PRINTERS"""
|
||||
Try { Remove-Item "${Env:WINDIR}\System32\spool\PRINTERS\*" -Recurse }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
|
||||
## Start the spooler service
|
||||
Control-Service -Start -Name $SERVICE
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user