#43356 - 2003-07-27 08:18 PM
Re: Help with printer script - revised
|
rbardo
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 [ 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
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
|
Top
|
|
|
|
#43359 - 2003-07-28 10:37 PM
Re: Help with printer script - revised
|
rbardo
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
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
|
Top
|
|
|
|
#43362 - 2003-07-29 06:23 AM
Re: Help with printer script - revised
|
Kdyer
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
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 466 anonymous users online.
|
|
|