Solved

Crystal Report in WinXP, continued

Posted on 2004-08-07
2
478 Views
Last Modified: 2008-02-01
I got my answer from mysdaao.

Now I want to read the Registry information.

I am using the following code:

  Set objWShell = CreateObject("WScript.Shell")
  strTest = objWShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Printers\...\Port")
  strTest = objWShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\...\DsSpooler\driverName")
  strTest = objWShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\...\DsSpooler\portName")
  Set objWShell = Nothing

Now my problem is this:
First two commands are working correctly, but the third one which i need for portname generates an error of 'Type mismatch'.
Can anybody help me?
0
Comment
Question by:Parsi
2 Comments
 
LVL 2

Accepted Solution

by:
KJHDI12 earned 500 total points
ID: 11742674
portName is a REG_MULTI_SZ datatype. Meaning it can have one or more lines.

Documentation about this can be found here:
http://www.autohotkey.com/docs/commands/RegRead.htm

"When reading a REG_MULTI_SZ key, each of the components ends in a newline character (`n). If there are no components, OutputVar will be made blank. See FileSelectFile for an example of how to extract the individual components from OutputVar. Note: Windows 95 does not support the REG_MULTI_SZ value type."

variantTest =  objWShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\...\DsSpooler\portName")

Should fix it and return a array with all the ports (normaly only one).
0
 
LVL 2

Author Comment

by:Parsi
ID: 11745645
It worked,
Thanks a lot.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
A short article about a problem I had getting the GPS LocationListener working.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now