.Reg files support variables?

G

Guest

I have a very interesting situation. I have several machines that are using receipt printers. But for whatever reason, the driver on the printer defaults to a 'letter' sized paper. Even though the paper doesn't even fit into the printer. I've been in contact with the printer manufacturer, and they are of no help. So I've identified the registry key where that setting is stored, and have managed to get the information I need to switch it with .reg files. But there's one problem. It's stored under Hkey_current_user/really long GUID that is Username SPECIFIC!!!/Printers

Is there a variable that I can put into a .reg file to get around the whole GUID issue, as this .reg file needs to be username independent

Suggestions

Merrill
 
G

Guest

You shouldn't mess with the registry for this. Just reinstall another instance of the printer and delete the bad copy when you get it right. You can have the same printer installed as many times as you want.
 
T

Tamarin

This is not the problem. The printer driver works fine when I manually
change the paper type. The problem is that I must do this for each computer
and each username on each computer.

I have identified the registry key that controls this setting, but it has
the GUID in it. I need to know if I can put a variable in the .reg file to
handle this.

Merrill
 
K

Kelly

Hi,

You will have to set it to script to read the User ID. Here is an example
for OE:

Dim myShell, OE_ID, OE_ID2, OE_Tit_Key, p1, n, t, cn, mybox

Set ws = CreateObject("WScript.Shell")

On Error Resume Next

OE_ID = "HKEY_CURRENT_USER\Identities\Default User ID"
OE_ID2 = ws.RegRead(OE_ID)
OE_Tit_Key = "HKEY_CURRENT_USER\Identities\" & OE_ID2 &
"\Software\Microsoft\Outlook Express\5.0\"

p1 = "HKCU\Identities\" & OE_ID2 & "\Software\Microsoft\Outlook
Express\5.0\"

n = ws.RegRead(p1 & "WindowTitle")
t = "Change Name for OE"
cn = InputBox("Type in the name wanted.", t, n)
If cn <> "" Then
ws.RegWrite p1 & "WindowTitle", cn
End If

MyBox = MsgBox("You must close and re-open OE to see the changes.",
vbOKOnly,"Done")
 
T

Tamarin

Guess I'll have to learn some scripting. Grr.

Be nice if the printer driver would just default to the paper type that it
actually takes!

I'll go over your script code and see what I can do, thanks.

Merrill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top