Jump to content

Restart printer spooler in Win 9x/ME?


Shibuya
 Share

Recommended Posts

i'm trying to do a script that sets the printer port of a printer

so far i've figured out to do it via editing the registry

apparently for NT based platforms, it requires restarting of the spooler, ("net stop spooler", then "net start spooler" in the command prompt) for the settings to take effect.

i want to do the same for the Win9x/ME platforms, but seems that "net stop/start spooler" is not an accepted command.

Anyone can tell me what i should do to go about it?

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Link to comment
Share on other sites

In Win 9x/ME services are not possible.

"spool32.exe" do the printer spooling thing

You can found it in "drive:\windir\system\spool32.exe"

It is only active for the spooling time when you start a printjob.

So your script should work without any commands.

Link to comment
Share on other sites

@Westi

I just tested the script and checked, my file isn't printing to the file port.

I'm including the script below to make things clearer:

$printer_name = "HP OfficeJet"
$printer_port = "FILE:"

RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\" & $printer_name, "Port", "REG_SZ", $printer_port)

;the code here below is actually meant for NT based systems to restart the spooler
;restarting the spooler makes the changes to the registry take effect immediately for the above case. It doesn't work for Win 9x/ME platforms
RunWait("Net Stop Spooler", "", @SW_HIDE)
RunWait("Net Start Spooler", "", @SW_HIDE)

I've looked thru MSDN and other knowledge bases, which mentioned a little of WMI with regards to the writing of printer drivers to the registry.

Do I need to use WMI as well to make the changes take effect?

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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