Where to find installation directory




















There are a few different techniques, but they really perform differently. I used the new performance monitoring report graph in PowerShell Studio and PrimalScript to test them. You need to include the program name, but you can take it from a parameter and use wildcards to hedge your bet.

Thanks to Liviu on Facebook for the link. Unfortunately, CIM is notoriously slow. Getting the class without any filtering takes an average 30 seconds. Memory: Here's the performance graph from the Performance tab. CIM must be caching and dumping in the middle of the operation. In a second operation, the filtering time is negligible and well within the margin of error. Here are variations of the command with filtering to get the InstallationLocation property of the CIM object.

In each case, I copied the performance data from the Output tab and placed it in comments before the command. Here's the comparative graph of the three commands in sequence. There's really not much you can do to speed this up when the base operation is so slow. You can also search the registry for the installation directory.

The InstallProperties registry key for the program has an InstallLocation value that stores the installation path.

Let's use PowerShell get the installation directory in that InstallLocation registry value. Then, look for the InstallProperties key whose DisplayName property matches the program name or a name pattern with wildcards.

When you find a match for the program name, use Get-ItemProperty on the same registry key to get the data in the InstallLocation registry value. The Get-ItemProperty commands look repetitive e. DisplayName , but the Windows PowerShell registry provider returns a custom object for the DisplayName registry value, so you need to get the DisplayName property of the DisplayName custom object. Same with all registry values, including InstallLocation.

Let's make this faster! After reading Aaron Jensen's pshdo registry code in the awesome Carbon module, I replaced the original Get-ItemProperty calls with calls to the getValue method of registry keys Microsoft.

RegistryKey , like the ones that Get-ChildItem returns in the registry. The getValue method takes the name of a registry value in the registry key, like DisplayName and InstallLocation and returns its data. In the Carbon module I recommend it!

It gets installation information for all users, not just tthe current user. Be sure to run elevated 'Run as adminstrator' or you get a bunch of Access Denied errors with your output. And, it's super-fast: milliseconds. Do you see the program listed as an entry??? If you find the entry, i'll tell you what to do next. Similar threads. Replies 1 Views Oct 26, Kshipper. Replies 8 Views Nov 4, Newguy Screen froze while installing ubuntu. Replies 0 Views Aug 13, techinfozone. Latest posts. Dimitriid replied 16 minutes ago.

Space startup wants to sling satellites into orbit with a huge centrifuge ScottSoapbox replied 30 minutes ago. Wearable devices will let you feel cold, heat, and pain in VR by applying chemicals to ScottSoapbox replied 36 minutes ago.



0コメント

  • 1000 / 1000