Solved

Setting printer attributes from VB Script

Posted on 2009-04-07
1
981 Views
Last Modified: 2012-05-06
We have a VBS script that does most of the setup for an application.  

We have a Generic / text only printer installed, I am looking for a way for the VBS script to change the form to tray assignments to Envelope#10 and in Printer Commands to set Begin and End print job commands.

I can do all this manually, but am looking to script it so users can make the changes themselves.

Thanks in advance.
0
Comment
Question by:JohnAR
[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
1 Comment
 
LVL 3

Accepted Solution

by:
JohnAR earned 0 total points
ID: 24215619

After some digging around I found that you cant directly set individual settings from VBS (or other)

I manually made the changes I needed, then using the following code I can read these settings into an array, to apply them it just a metter of using SetBinaryValue and passing the array


Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
 
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Generic / Text Only\PrinterDriverData"
strValueName = "TTY DeviceConfig"
 
oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrValues
 
count = 0
 
wstmp = "PrinterDeviceConfig=array("
For Each strValue In arrValues
 
	if count = 0 then  wstmp = wstmp & strValue 
	if count <> 0 then  wstmp = wstmp & "," & strValue 
 
	count = count + 1
Next
 
wstmp = wstmp & ")" 
Wscript.Echo "Array " & wstmp

Open in new window

0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

636 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