Printer Settings

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
stinger
Newbie
Posts: 11
Joined: Thu May 11, 2006 2:50 pm

Printer Settings

Post by stinger » Thu May 11, 2006 3:03 pm

When I logon at the office network printers are added to group printer and the default printer has a duplex setting at True.
The problem is that I have to reset it manually to print my printing project on one page-side only.
Do you have a VBS solution to change the duplex setting to off.

Thank you !

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu May 11, 2006 5:35 pm

Wouldn't it be easier to create a second network print resourse for the printer and have the duplex printing turned off in it. Then use the second resourse as your default printer?

If you don't know how to do this or don't have access, ask your network administrator to set it up for you.

Later,
Dick

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu May 11, 2006 5:58 pm

Here's a simple one-line method.

Manually remove duplex mode and then go to a command prompt and type this:

rundll32 printui.dll,PrintUIEntry /Ss /n "printer" /a "file.dat"

Where printer is the name of the printer and file.dat is the file to store it. The /Ss switch stores all printer settings into the file.

Now create this script:

Let>RP_WAIT=1
Run>rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat"

The /Sr switch restores printer settings from the file. So this script will restore to the settings you saved when you ran the /Ss line and stored the settings in the file.

For more options and info do this at the command line:

rundll32 printui.dll,PrintUIEntry /?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

stinger
Newbie
Posts: 11
Joined: Thu May 11, 2006 2:50 pm

Post by stinger » Fri May 12, 2006 12:42 pm

Thank you for your answer. This is great.
I was able to produce the .dat file but was not for the second part of Marcus solution. When I execute the script the printer alert box show the message Impossible to finish the task.
Any clue why.
Thank you again!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 12, 2006 12:48 pm

Typo in the filename or path? Make sure the printer name and the path to the .dat file is correct.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri May 12, 2006 12:52 pm

E.g:


To create the file:
Run>rundll32 printui.dll,PrintUIEntry /Ss /n "laserjet1100" /a "c:\settings\laserjet.dat"

To restore the file:
Run>rundll32 printui.dll,PrintUIEntry /Sr /n "laserjet1100" /a "c:\settings\laserjet.dat"
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

stinger
Newbie
Posts: 11
Joined: Thu May 11, 2006 2:50 pm

Post by stinger » Fri May 12, 2006 1:48 pm

Thank you Again,

I'm actually connected twru a VPN connection when I'm working from home witch it is the case now. With my local printer, Adobe PDF, I'm able to apply the solution.

rundll32 printui.dll,PrintUIEntry /Ss /n "Adobe PDF" /a "c:\imp_PDF.dat"
rundll32 printui.dll,PrintUIEntry /Sr /n "Adobe PDF" /a "c:\imp_PDF.dat"

With the network printer, I'm able to create the file but not to restore it, the error message is still there on the file restore.

rundll32 printui.dll,PrintUIEntry /Ss /n "\\Mnrs05pp\MP502393" /a "c:\imp.dat"
rundll32 printui.dll,PrintUIEntry /Sr /n "\\Mnrs05pp\MP502393" /a "c:\imp.dat"

I'll try it when I will be logged at the office.

Thank you again for your help, it is appreciated.

stinger
Newbie
Posts: 11
Joined: Thu May 11, 2006 2:50 pm

Post by stinger » Tue May 16, 2006 4:11 am

Hello Marcus,

For your question on rights regarding the network printer, it must be user right cause I have changed de duplex setting manually and generated the .dat file has prescribed by your solution. Unfortunatly, when I run the command line:
rundll32 printui.dll,PrintUIEntry /Sr /n \\Mnrs05pp\MP502393 /a C:\imp.dat
or run the script I have the error message.

Thank you !

Patrice

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts