Hello,
I am trying ( as much as a beginner can try) to write a script that will display a users default printer among other things. Here is the portion of the script that That I have so far that does indeed echo the default printer, but I would like to learn how to extract the printer name only and not the other superfluous information. This script is going to reside on the end users desk top and will serve as a tool for gathering pc information that will assist the helpdesk before we establish remote control connections.
dim defaultprn
Set WshShell = CreateObject("WScript.Shell")
defaultprn = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device")
msgbox defaultprn
the out put form this script is "\\printserver\prn4424,winspool,Ne06:"
The actual printer name buried in this string that would be recognizable to an end user is "prn4424" because that is the network name of the printer. I am curious to know how to parse or separate out that part of the line , leave the rest behind and display that value in a popup or text box.
Any help on this would be greatly appreciated.
Fred
I am trying ( as much as a beginner can try) to write a script that will display a users default printer among other things. Here is the portion of the script that That I have so far that does indeed echo the default printer, but I would like to learn how to extract the printer name only and not the other superfluous information. This script is going to reside on the end users desk top and will serve as a tool for gathering pc information that will assist the helpdesk before we establish remote control connections.
dim defaultprn
Set WshShell = CreateObject("WScript.Shell")
defaultprn = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device")
msgbox defaultprn
the out put form this script is "\\printserver\prn4424,winspool,Ne06:"
The actual printer name buried in this string that would be recognizable to an end user is "prn4424" because that is the network name of the printer. I am curious to know how to parse or separate out that part of the line , leave the rest behind and display that value in a popup or text box.
Any help on this would be greatly appreciated.
Fred