How can I get a list of installed applications on a remote 2003 server?
I have tried this code but it is blank output.
computername = "\\%compname%" ;for REMOTE COMPUTER
string="WindowsInstaller"
topkey=@REGMACHINE ; start at HKEY_CURRENT_USER
topsub="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
handle = RegConnect(computername, topkey)
teststring="DisplayName"
looktype=0 ; look at REG_SZ string values
lookat=2|8 ; look for wholestring matches only, in all registry types: Keys, Values, Data
dosubtree=@True ; do not return subtree contents
retall=rRegSearch(handle,topsub,teststring,looktype,lookat,dosubtree)
list = ""
count=ItemCount(retall,@tab)
For xx = 1 to count
keypath = ItemExtract(xx,retall,@tab)
newkey = StrReplace(keypath, string, "DisplayName")
if RegExistValue(handle,newkey)
name = RegQueryValue(handle,newkey)
list = StrCat(list,@tab,name)
endif
Next
list = StrReplace(StrTrim(list),@tab,@cr)
message("Product list",list)