Solved

Enable Advanced Printing Features

Posted on 2012-04-01
6
1,260 Views
Last Modified: 2012-04-02
When I run that scripts it pops (check attachment)..All I want is to enable or disable the feature on a chosen printer on teh printer server.

'To Enable Advanced Printing Features
'RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n "printer name" attributes -RawOnly

'To Disable Advanced Printing Features
'UNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n "printer name" attributes +RawOnly


Const ForReading = 1
dim printer
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\printers.txt", ForReading)
Set objShell = CreateObject("Wscript.Shell")
Do while not objFile.AtEndOfStream
    Printer = objFile.ReadLine
    Printer = "\\???\U150C1-Costar"
    Wscript.echo printer
    strCmd = "rundll32 printui.dll,PrintUIEntry /xs /n " &  printer & " attributes +RawOnly"
    objShell.Run StrCmd
Loop
objFile.Close
0
Comment
Question by:Bianchi928
  • 3
  • 3
6 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 37794734
Hi, I can't see the attachment...
0
 

Author Comment

by:Bianchi928
ID: 37795434
oops sorry. Like you'll it's looking at the printer server properties instead. ALl I want is to be able /disable the "Advanced Printing Features"
screen.JPG
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 37799316
Hi, I think the only problem was that you need a capital X following by a lower case s but I have also put quotes around the printer name, just in case.

    strCmd = "rundll32 printui.dll,PrintUIEntry /Xs /n """ &  printer & """ attributes +RawOnly

Regards,

Rob.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Bianchi928
ID: 37799401
I've got an Unterminated string constant on Line 16

'To Enable Advanced Printing Features
'RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n "printer name" attributes -RawOnly

'To Disable Advanced Printing Features
'RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n "printer name" attributes +RawOnly


Const ForReading = 1
dim printer
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\documents and settings\cis0794\desktop\printers.dat", ForReading)
Set objShell = CreateObject("Wscript.Shell")
Do while not objFile.AtEndOfStream
    Printer = "Lexmark T654 PS3"
'   Printer = objFile.ReadLine
    strCmd = "rundll32 printui.dll,PrintUIEntry /Xs /n """ &  printer & """ attributes +RawOnly

    objShell.Run StrCmd
Loop
objFile.Close
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 200 total points
ID: 37799416
Oops, sorry. I forgot to add the closing quote.

    strCmd = "rundll32 printui.dll,PrintUIEntry /Xs /n """ &  printer & """ attributes +RawOnly"

Rob.
0
 

Author Closing Comment

by:Bianchi928
ID: 37799437
Perfect
Thanks mate
Cheers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 55
Exit Loop after User Input 4 41
Scraping specific data within an XML document 19 54
Only allow one site in Internet Explorer on XenApp. 9 51
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now