Mike Pratt
(Fresh Scripter)
2004-11-30 06:56 PM
Removing Novell Queues on Windows 2K Pro

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


NTDOCAdministrator
(KiX Master)
2004-11-30 07:58 PM
Re: Removing Novell Queues on Windows 2K Pro

Been many, many years since I was on Novell, but I'm not sure what you mean by Novell print queues on the PC. I thought the print que was only on the Server.

Can you please provide a little more detail of the issue or clarify for me what/why a print que is on a local PC and not a Server. Is it just a terminology thing or is there in fact a print que on the local PC?


Mike Pratt
(Fresh Scripter)
2004-11-30 08:20 PM
Re: Removing Novell Queues on Windows 2K Pro

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


NTDOCAdministrator
(KiX Master)
2004-11-30 09:03 PM
Re: Removing Novell Queues on Windows 2K Pro

I think Les wrote some script for that a long while back. He had to run off and go do something. Hopefully he will be back in a bit and perhaps he remembers the link for that posting.

ShaneEP
(MM club member)
2004-11-30 09:06 PM
Re: Removing Novell Queues on Windows 2K Pro

You can try Jooel's DelPrinterConnections() UDF. This should remove all network printer connections if I recall correctly.

Mike Pratt
(Fresh Scripter)
2004-11-30 09:39 PM
Re: Removing Novell Queues on Windows 2K Pro

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


ShaneEP
(MM club member)
2004-12-01 01:23 AM
Re: Removing Novell Queues on Windows 2K Pro

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.


Mike Pratt
(Fresh Scripter)
2004-12-01 04:37 PM
Re: Removing Novell Queues on Windows 2K Pro

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


ShaneEP
(MM club member)
2004-12-01 11:11 PM
Re: Removing Novell Queues on Windows 2K Pro

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