Page 2 of 2 <12
Topic Options
#43356 - 2003-07-27 08:18 PM Re: Help with printer script - revised
rbardo Offline
Fresh Scripter

Registered: 2003-07-24
Posts: 47
Loc: USA
Hey Kent,

Thanks..
First off, there is no 9x machines on my network. I blew those bastards up as soon as I got there...

Second, The adam thing, please forget about it. It was only an example of an exported reg key that I needed to edit only the values of "personal" and "My pictures". Since I figured that merging the keys with regedit /s was too difficult for that specific key due to the username thing, I just used WRITEVALUE.

As for the $installregfiles variable function, that is used for any keys that can merge easily with no user specific complications. I simply put a regfiles folder in my netlogon folder and i just put the keys in there, no matter how many, and it will just merge all that is in the folder...

Lastly, the last line you asked about... That is a legal disclaimer. The exe was created to pull from a .rtf file in the same netlogon dir and displays within a gui window with only an accept button. The user must click accept to close the window... Thats why I like it last, and when it runs, it gives me a visual indicator that the rest of the script has completed..

Thanks again for your help, Im learning, I guess you could see that..

ps. Did you have any problems with the printers.inin file being created? I cant get that file created anywhere..??

--Rob [Big Grin] [Big Grin] [Big Grin] [Eek!]

[ 28. July 2003, 04:45: Message edited by: rbardo ]
_________________________
Ekadanta Mahakaya Surya koti samaprabha Nirbighnam kurume deva sarbakaryeshu sarbada

Top
#43357 - 2003-07-28 07:14 AM Re: Help with printer script - revised
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Rob,

quote:

Did you have any problems with the printers.inin file being created? I cant get that file created anywhere..??

What is this?

In our environment, the H: Drive is the client's home drive that they would have access to.

Maybe some more testing is in order?

in the PRINTERS.KIX code -
code:
   ;printers.kix
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DIM $prireg, $x, $i, $rc, $ps
$loc='HKEY_CURRENT_USER\Network\LPT1'
$reg='HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion'
$dev=$reg+'\Devices'
$nprt=Split(ReadValue($reg+'\Windows','Device'),',')[0]
$sysdrv=SubStr('%WINDIR%',1,2)

IF Exist('Z:')
$ps='Z:\Scripts_DO_NOT_DELETE'
ELSE
$ps=$sysdrv+'\Scripts'
ENDIF
IF 0=Exist($ps)
MD $ps
ENDIF
$ps=$ps+'\Printsetup.ini'

Change this to -

code:
   ;printers.kix
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DIM $prireg, $x, $i, $rc, $ps
$loc='HKEY_CURRENT_USER\Network\LPT1'
$reg='HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion'
$dev=$reg+'\Devices'
$nprt=Split(ReadValue($reg+'\Windows','Device'),',')[0]
$sysdrv=SubStr('%WINDIR%',1,2)

IF Exist('Z:')
$ps='Z:\Scripts_DO_NOT_DELETE'
ELSE
$ps=$sysdrv+'\Scripts'
ENDIF
IF 0=Exist($ps)
MD $ps
ENDIF
?$PS
?'Press a key to continue'
Get $
$ps=$ps+'\Printsetup.ini'

You should be able to get the drive and directory and find where you are placing the INI file.

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#43358 - 2003-07-28 03:09 PM Re: Help with printer script - revised
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11161
Loc: Boston, MA, USA
Or use DEBUG ON in appropriate place inside your sacript to step through the script and find the lines that do not work correctly.
_________________________
There are two types of vessels, submarines and targets.

Top
#43359 - 2003-07-28 10:37 PM Re: Help with printer script - revised
rbardo Offline
Fresh Scripter

Registered: 2003-07-24
Posts: 47
Loc: USA
Sweetness!!!

Got it!

one last question on this puppy...

I dont see the local printer installed listed in the .ini file? DOes this script only encompass network mapped printers?

Thanks,

Rob
_________________________
Ekadanta Mahakaya Surya koti samaprabha Nirbighnam kurume deva sarbakaryeshu sarbada

Top
#43360 - 2003-07-29 12:22 AM Re: Help with printer script - revised
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Rob,

If we look at the script, it is using the INI file to read this information in from, specifically -
code:
$nprt=ReadProfileString($ps,'Printers','Default')
$rc=SetDefaultPrinter($nprt)
USE LPT1: $nprt /persistent

How do I know if I have an LPT1, being re-directed?

Go to a CMD prompt and issue a NET USE and you should see LPT1 being re-directed..

If you wanted to test that, you could do a redirect from the console to the LPT1..

For example,

dir > lpt1

or -

Type boot.ini > lpt1

What either of these examples do is to send to the LPT1 rather than the console.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#43361 - 2003-07-29 12:36 AM Re: Help with printer script - revised
rbardo Offline
Fresh Scripter

Registered: 2003-07-24
Posts: 47
Loc: USA
Hey Kent,

Thanks for the reply. I think I was misunderstood...

Here is the situation: I have a local printer installed physically on the LPT1 port. I also have a network connected printer installed (\\servername\8550dn) and I have another printer installed on a specific tcp/ip port (konica copier / printer).

The only thing I see in the .ini file created by the script is the (\\servername\8550dn).
Am I missing something?

help....? [Frown]

Thanks again guys for the exercised patience.

ps. The rest of the entire script works great thanks to all the help that was provided to my newbie arse..
_________________________
Ekadanta Mahakaya Surya koti samaprabha Nirbighnam kurume deva sarbakaryeshu sarbada

Top
#43362 - 2003-07-29 06:23 AM Re: Help with printer script - revised
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
The intent of the INI file was to capture installed network printers, for when a client either logs into another workstation or gets a new system. If you have a locally installed LPT1 printer and is set as default, this script should take that into account. Also, back at the FAQ, there is a local installed printer capture script too.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#43363 - 2003-07-29 07:20 PM Re: Help with printer script - revised
rbardo Offline
Fresh Scripter

Registered: 2003-07-24
Posts: 47
Loc: USA
Cool thanks, Ill incorporate both functions..

while trying to keep efficient and not redundant in anyway.. (pun?)

[Big Grin]
_________________________
Ekadanta Mahakaya Surya koti samaprabha Nirbighnam kurume deva sarbakaryeshu sarbada

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Chris S., Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Jochen) and 190 anonymous users online.
Newest Members
MikeKrausnick, Ruggiero, xempa333, KroodjeBip, Thala
17470 Registered Users

Generated in 0.033 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org