[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Enable Advanced Printing Features

Posted on 2012-04-01
6
Medium Priority
?
1,412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 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