I think this is a simple question for someone. I am reading the default printer from my registry. I want to make a script that takes this value and turns it into an LPT1 printer. Don't ask, at work using an inhouse app that needs LPT1 mapped (poorly written app). My script is just two lines and will work, but the data in the string has too much info. I need to just grab data up to the comma. The lenghts of the data very so I can't count characters and chop.

Here is what the Default Printer data looks like in the registry: (I need whats in RED only, stopping at the first comma)

\\PrintServer\PrinterName,winspool,Ne01:

Code:
  
$defprinter = ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device")

USE LPT1: \\$defprinter



Any ideas?

BNutz