Reg Query Issues

Posted by Fitz on Server Fault See other posts from Server Fault or by Fitz
Published on 2009-11-23T20:55:49Z Indexed on 2010/04/20 6:04 UTC
Read the original article Hit count: 436

I have a batch script that does reporting on our systems and part of it queries the registry for information. The script fails to get the key's value when its ran by the system, but whenever I run the script myself, it works perfectly

the command:

REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\ScanMail for Exchange\CurrentVersion" /v PatternStringFormatted > current1.tmp

should return:

HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\ScanMail for Exchange\CurrentVersion
    PatternStringFormatted    REG_SZ    6.645.00

This script is failing on a Server 2008 R2 machine, but runs fine on Server 2003 R2 machines.

© Server Fault or respective owner

Related posts about batch

Related posts about windows-server-2008