Hi,
I´m new to this board and got a newbie question. How do I get the last part of a variable? I´m running Metaframe with local and network printers and I want to know the default printer. I got a script, from here, which checks this but it can look like "Client\computername#\\\server\HP LaserJet 4100 PCL 6" to "HP Laserjet 4100 PCL 6". I´m just interested in the last part the name, the printername. How do I do this? The script I´m using is:
Code:
$PrinterKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"
$PrinterVal = "Device"
$TempString = READVALUE ($PrinterKey, $PrinterVal)

;The Printername is the first part of the registry value
$x = INSTR($TempString,",")
$DefPrint = SUBSTR($TempString,1,$x-1)

$DefPrint

Regards Lars