#117851 - 2004-04-14 10:59 AM
Last part of variable
|
lawe009
Fresh Scripter
Registered: 2004-04-14
Posts: 36
|
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
|
|
Top
|
|
|
|
#117853 - 2004-04-14 12:05 PM
Re: Last part of variable
|
lawe009
Fresh Scripter
Registered: 2004-04-14
Posts: 36
|
Thanx Jochen, Works fine. Regards Lars
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1471 anonymous users online.
|
|
|