[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Enable Advanced Printing Features

Posted on 2012-04-01
6
Medium Priority
?
1,434 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 800 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month19 days, 16 hours left to enroll

872 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