#130370 - 2004-11-30 06:56 PM
Removing Novell Queues on Windows 2K Pro
|
Mike Pratt
Fresh Scripter
Registered: 2003-10-17
Posts: 18
Loc: Maine
|
Hi,
I am doing some research on how to remove Novell print queues on Windows 2000 Pro PCs that we are migrating to an Active Directory environment. I have seen some posts from last year re: using the SendKeys() but cannot find any info when I do a board search. Can anyone give me a hand?
Thanks, Mike
|
Top
|
|
|
|
#130372 - 2004-11-30 08:20 PM
Re: Removing Novell Queues on Windows 2K Pro
|
Mike Pratt
Fresh Scripter
Registered: 2003-10-17
Posts: 18
Loc: Maine
|
Thanks for the reply - sorry for the confusing terminology; what I meant was there are Novell network printers setup on Windows 2000 Pro client PCs that I need to delete during the migration to AD...so I'm looking for a way to script the deletion of those Novell printers on the PCs...
Thanks, Mike
|
Top
|
|
|
|
#130374 - 2004-11-30 09:06 PM
Re: Removing Novell Queues on Windows 2K Pro
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
You can try Jooel's DelPrinterConnections() UDF. This should remove all network printer connections if I recall correctly.
|
Top
|
|
|
|
#130375 - 2004-11-30 09:39 PM
Re: Removing Novell Queues on Windows 2K Pro
|
Mike Pratt
Fresh Scripter
Registered: 2003-10-17
Posts: 18
Loc: Maine
|
CitrixMan,
Thanks for the suggestion. This UDF is handy for deleting Windows Network Printers but not Novell. The Novell Printers are created in HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers and have ,, before each printer connection. Could I delete all of the printers in that key that began with ,,?
Thanks, Mike
|
Top
|
|
|
|
#130376 - 2004-12-01 01:23 AM
Re: Removing Novell Queues on Windows 2K Pro
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
Shouldnt be a problem in theory. Made a couple of small modifications to the previously mentioned UDF to get this..Give it a try.
Code:
function DelNovellPrinterConnections() dim $c,$bk,$conn $c=0 $bk="HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers" $conn=enumkey($bk,$c) while @error=0 $c=$c+1 if left($conn,2)=",," $conn=delkey($bk+"\"+$conn) endif $conn=enumkey($bk,$c) loop endfunction
Also remember since these keys are located in HKLM, local admin priviledges may be required.
|
Top
|
|
|
|
#130377 - 2004-12-01 04:37 PM
Re: Removing Novell Queues on Windows 2K Pro
|
Mike Pratt
Fresh Scripter
Registered: 2003-10-17
Posts: 18
Loc: Maine
|
CitrixMan,
Great idea, but it didn't do anything when I ran the script...it didn't error out, but didn't delete any keys...
Thanks, Mike
|
Top
|
|
|
|
#130378 - 2004-12-01 11:11 PM
Re: Removing Novell Queues on Windows 2K Pro
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
Sorry about that. Just assumed that you were familiar with Kix enough to know how to use a UDF. The function will not do anything until its called somewhere in the script. Check out the FAQ How to use UDFs for more info.
Code:
DelNovellPrinterConnections()
function DelNovellPrinterConnections() dim $c,$bk,$conn $c=0 $bk="HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers" $conn=enumkey($bk,$c) while @error=0 $c=$c+1 if left($conn,2)=",," $conn=delkey($bk+"\"+$conn) endif $conn=enumkey($bk,$c) loop endfunction
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 466 anonymous users online.
|
|
|