Quantcast
Channel: Spiceworks Community
Viewing all articles
Browse latest Browse all 3098

Need Printer rename script help

$
0
0

So we are about to do a printer change out across the company.  I remembered from an old job that we used kix script to rename printers from old name to new name.


The problem is when I tried to run the kix script at my new job I realized that it is different for Windows 7 vs XP


So we have a batch file that launches the kix script below, but it will not remap my printers.  Any ideas?  Alternatives, I need to have a separate control file to list old printers and new printers.  We are not changing print servers, only printers with new names and drivers


  


Text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$pmap="\<DOMAIN CONTROLLER>\NETLOGON\IN_remap.ini"
echo
IF @INWIN=1
 FOR each $key in split(readprofilestring
("$pmap","PRINTER_MAP",""),chr(10))
  IF primapstate($key)
   $nul=addprinterconnection(readprofilestring
("$pmap","PRINTER_MAP",$key))
  IF primapstate($key)=2
   $nul=SETDEFAULTPRINTER (READPROFILESTRING
("$pmap","PRINTER_MAP",$key))
  ENDIF
   $nul=delprinterconnection($key)
  ENDIF
 NEXT
ENDIF
Function PriMapState($_Pri)
 IF len(readvalue("HKEY_CURRENT_USER\Printers\Connections\",
$_Pri))
  IF instr(readvalue("HKEY_CURRENT_USER\Printers\Connections
\","Device"),$_Pri)
   $PriMapState=2
  ELSE
   $PriMapState=1
  ENDIF
 ENDIF
EndFunction


Viewing all articles
Browse latest Browse all 3098

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>