Click to See Complete Forum and Search --> : KixTart Script Question


Tela
05-02-2002, 11:05 AM
I am trying to use a sample script found on this site at http://www.swynk.com/winscript/SCRIPT_AddNetworkPrinters.asp. The first part of the script checks to see if a printer (or list of printers) is installed, the second part adds printers that you specify if they aren't installed. Unfortunately, I don't know the correct place to add the names of printers you are checking for using the IF INSTR variable. Here is the script, where do you add the staement: IF INSTR($FullList,"\P_Fileserver-1Darth_Vader-Q") = 0 to the following:

$Index = 0
$FullList = ""
WHILE @ERROR = 0
$ValueName = ENUMKEY( "HKEY_CURRENT_USERPrintersConnections" , $Index )
IF @ERROR = 0
$ValueName = SUBSTR($ValueName,3,999)
$SERVERNAME= SUBSTR($Valuename,1,INSTR($ValueName,",")-1)
$Remainder = SUBSTR($ValueName,INSTR($ValueName,",")+1,999)
$SHARENAME= SUBSTR($Remainder,1,INSTR($Remainder," ")-1)
$UNC = "\"+$Servername+""+$ShareName
$FullList = $FullList+$UNC+";"
ENDIF
$Index = $Index + 1
LOOP


Thanks!!!