WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: int5749 on February 09, 2017, 12:09:47 AM

Title: Get installed Software from Remote PC
Post by: int5749 on February 09, 2017, 12:09:47 AM
Hi all,

I'm looking for a way to get all Software installed on a machine.
This shall work for local machine as well as for remote machines.
I looked around and found a Powershell Script, but this doesn't work for me :-(

And => I prefer to use WinBatch ;-)

Regards
Joerg
Title: Re: Get installed Software from Remote PC
Post by: td on February 09, 2017, 06:50:51 AM
The most likely reason our Powershell script did not work is that one of the necessary services is disabled on the remote machine either by default or intentionally for security reasons.  If that is the case then any WinBatch script is likely to run into similar issues.   If you can open up the remote machine to remote registry, remote WMI, RPC, or whatever access then either Powershell or WinBatch can be used to query the remote machine for installed software.   WinBatch has several options including native registry functions, COM Automation, and CLR hosting.

One slightly dated example:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/How~To+List~Applications~Installed~on~Remote~Machines.txt (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/How~To+List~Applications~Installed~on~Remote~Machines.txt)
Title: Re: Get installed Software from Remote PC
Post by: int5749 on February 09, 2017, 08:53:34 AM
Hi td,

thanks and remote registry is working fine, but I got an error with line
type = RegEntryType(topkey,keystring)
in your script.

Keystring is gathered and extracted like => SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Software 1[DisplayName]

Then i got an error 1452 can't open subkey :-/

Regards
Joerg
Title: Re: Get installed Software from Remote PC
Post by: td on February 09, 2017, 10:57:58 AM
Either the value doesn't exist, you don't have read permission on the value or you are using the wrong registry view (32-bit or 64-bit.)  You have to determine which is the case. 
Title: Re: Get installed Software from Remote PC
Post by: int5749 on February 10, 2017, 02:07:06 AM
Value has been read from Registry so I have sufficient permission while I'm Administrator as well.
In Addition I tried now type = RegEntryType(topkey,keystring,32) and type = RegEntryType(topkey,keystring,64) which both still fail :-(

I uses that function regulary but I have no idea why i doesn't work this time ;-(

Additionaly I tried my local machone as well, with same result

Any help/hint is much appreciated
Title: Re: Get installed Software from Remote PC
Post by: td on February 10, 2017, 07:08:06 AM
First to clear up a common misconception, being an admin doesn't guarantee access.  Although in this case it would be unusual for a local admin account to not have access to a value under the "uninstall" key.   

The error has to be the result of one of the three previously mentioned reasons.  So  perhaps you need to take another look at your assumptions.  For example, the  space between 'Software' (whatever the actual name may be) and '1' in your subkey path looks suspect.