Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Which applications does get-command detect?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-11-2007   #1 (permalink)
Andrew Watt [MVP]
Guest


 

Which applications does get-command detect?

I've been playing around a little with get-command to figure out which
"Applications" it detects if you give it a command like:

get-command * -commandType Application | more

It displays a ton of stuff under C:\Windows. The only other thing that
is displayed on my main machine are SQL Server 2005 files or Visual
Studio 2005 files. Nothing else. No Office apps, for example.

If you run the following commands do you see any applications other
than those from SQL Server 2005 or Visual Studio 2005?

get-command *.exe |
where-object {$_.Definition -notmatch "Windows"} |
more

Or to be more comprehensive

get-command *.exe,*.dll |
where-object {$_.Definition -notmatch "Windows"} |
more

Just curious.

Andrew Watt MVP

My System SpecsSystem Spec
Old 01-11-2007   #2 (permalink)
Maximilian Hänel
Guest


 

Re: Which applications does get-command detect?

Hi Andrew,

> I've been playing around a little with get-command to figure out which
> "Applications" it detects if you give it a command like:
>
> get-command * -commandType Application | more
>
> It displays a ton of stuff under C:\Windows. The only other thing that
> is displayed on my main machine are SQL Server 2005 files or Visual
> Studio 2005 files. Nothing else. No Office apps, for example.


But it displays word documents etc, too - if they are in an application
search path. So I guess gcm displays all file types with a shell
execution handler (<- not sure if that's the right name). In other
words: gcm lists everything you can "start" in PS. If you copy a word
document to the windows directory, you can "start" this document by typing

PS> .\Document.doc

That's because word documents can be opened by means of "ShellExecute".
If you now type

PS> get-command *.doc -commandType Application | more

it should display the document.doc.

But I'm just guessing...

cu

Max
My System SpecsSystem Spec
Old 01-11-2007   #3 (permalink)
Maximilian Hänel
Guest


 

Re: Which applications does get-command detect?

Hi again,

> If you copy a word
> document to the windows directory, you can "start" this document by typing
>
> PS> .\Document.doc


Sorry, that's a bad example ;-) You can actually open the document by
just typing

PS> Document.doc

regardless of the current directory.

cu
My System SpecsSystem Spec
Old 01-12-2007   #4 (permalink)
JensG
Guest


 

RE: Which applications does get-command detect?

Hello Andrew,

> It displays a ton of stuff under C:\Windows. The only other thing that
> is displayed on my main machine are SQL Server 2005 files or Visual
> Studio 2005 files. Nothing else. No Office apps, for example.


Another issue might be, that the search method is obviously quite different
from the "Start button / Run command" box. For example, I type in IEXPLORE,
which opens the IE.

Not so in PowerShell. Probably this is because the PowerShell does not use
the AppPaths from the registry, which act as kind of an alternative search
path for executables:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

Note they are not located under "Explorer" or any "Shell" entry, they're
general. Is there any reason why the powerShell should not use these paths?
Adding a custom function could be a solution. If anyone knows of a better
one, please let us know.

JensG

My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Applications shut down when print command given Larryjn Vista hardware & devices 1 05-21-2008 12:42 AM
Command Line Ren (Rename) command broken? SixSigmaGuy Vista General 5 05-20-2008 05:52 AM
Several applications are trying to access the internet to specific ip address 10.0.0.138 & 224.0.0.2, while ARE NOT internet applications! ref/eDN3072784783 dennis Vista General 1 09-27-2007 06:08 AM
get-command and *.txt "applications" Andrew Watt [MVP] PowerShell 2 01-11-2007 12:29 PM
formatting command syntax like get-help or get-command klumsy@xtra.co.nz PowerShell 1 10-18-2006 12:04 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51