Link to home
Start Free TrialLog in
Avatar of evansong
evansong

asked on

Printer setting

Hello,
I am stuck at the point where I have to make clients to reboot their machine in order for them print with separator pages.
I was able to install the printer drivers and printer using "Rundll32 printui.dll,printuientry"; however, I can't make printer to print separator page without rebooting the machine.   If I assign the filename directly into printer's property -> Advanced -> Separator Page, then it works and I don't have to reboot the machine; however, if I assign the value directly to registry by command line or through VB.NET or C#, I have to reboot in order for printer to print a separator page.
My question is, is there a way to assign a separator page and make printer print separator page without rebooting the machine, or is there a way to refresh the registry certain section??

The registry value that I changed were,

Key -> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\HP LaserJet 4/4M Plus PS 600]
String Value name -> "Separator File"
String Value Data -> "C:\\WINDOWS\\system32\\pscript.sep"

and,

Key -> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\HP LaserJet 4/4M Plus PS 600\DsSpooler]
String Value name -> "printSeparatorFile"
String Value Data -> "C:\\WINDOWS\\system32\\pscript.sep"

but then, I also notice the "changeID" (a binary value) which locates in both "4M Plus PS 600" key and "DsSpooler" key, changes whenever I change some setting in Control Panel -> Printers -> HP LaserJet 4/4M Plus PS 600.
And so, I was wondering if this "changeID" was to keep tracks of changes and refresh printer setting somehow.   The only problem is that it looks though the "changeID" value is randomly generated and I wasn't able to find the pattern.  Also, I have this strong feeling that this seperator file is changed through "rundll32 printui.dll,PrintUIEntry".
But how?

Any thoughts?

Thank you again,

Evan
Avatar of hdhondt
hdhondt
Flag of Australia image

Registry settings should be active immediately, without rebooting. Hence you must be doing something wrong when you write the change, so that the change isn't actually writen into the registry until the application quits or the PC shuts down.
Avatar of evansong
evansong

ASKER

hi hdhondt,

I wasn't doing anything wrong.. because after running the application, when I checked the registry, I found the changes in the registry.  
Key -> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\HP LaserJet 4/4M Plus PS 600]
String Value name -> "Separator File"
String Value Data -> "C:\\WINDOWS\\system32\\pscript.sep"

Key -> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\HP LaserJet 4/4M Plus PS 600\DsSpooler]
String Value name -> "printSeparatorFile"
String Value Data -> "C:\\WINDOWS\\system32\\pscript.sep"

These two values were added properly, but it didn't show up in the Printer's property -> Advanced -> Separator Page....
It shows up when I reboot the machine.  And if what you said is true, then the separator file should take affect immediately, but it's not.  I think it has to do with "chageID" (a binary value).   Do you have any clue what it is and how to change it to make printer prints separator page that I specified through registry??

Also, do you know how to show total page number show up in the separator page (POSTSCRIPT)??
I tried so many different combination but can not find a way to print total page number the person is printing.
For instace,
name is (@N)
jobid is (@I)
date (@D)
time (@T)

What is code for total page?

Thank you hdhondt :)
There is no separator page code for the number of pages. However it is possible to send PostScript commands to the printer to do that, and even to print them on a page. This is not a trivial question though - unless you're a PostScript expert, which I'm not.

I'll give it some thought...
Hi hdHondt,

well, I figured the problem out.  All I had to do was restart the printing service and the computer refresh the registry information and set the separator page without rebooting the machine :)

However, I would really like to print "TOTAL PAGE" count into separator page.  And..

http://www.windowsnetworking.com/kbase/WindowsTips/Windows2000/AdminTips/Network/SharedprinterseparatorpageforWindows2000andWindowsXP.html

this site shows some codes; however, no indication of whether how to print total page number into the separator page.

Evan
As I said before, there is no separator code for the number of pages printer. The separator page just sends data to the printer, hence it cannot know anything from the printer. However, it is possible to send PostScript commands to the printer as part of sysprint.sep so the printer prints the page count.

However, this is very much a different question to the original one, and I suggest you close this question and ask for a refund of your points as you solved the question yourself. Then start a new question about printing the total pagecount on the separator page.
Ok.. i will post a new post and close this question.
The answer to my problem was solved by the following:

1) execute command line, net stop spooler
2) and then modified the print registry
3) and when I finish editing registry, I executed command line, net start spooler

The modified version of registry was taken affect without rebooting the machine.

Thank you again for your help hdhondt.  :)  I hope to see you again from new post!

Evan
ASKER CERTIFIED SOLUTION
Avatar of Lunchy
Lunchy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial