Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 504445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:29:52+00:00 2026-05-13T06:29:52+00:00

I am trying to use powershell to get the file version of a file.

  • 0

I am trying to use powershell to get the file version of a file. If I right click the file and look at the version, it shows a value. Here is how I am trying to do it:

$path = "MSDE2000A";
$info = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($path);

Here is the exception information it is throwing:

Exception calling "GetVersionInfo" with "1" argument(s): "MSDE2000A.exe"
At line:1 char:58
+ $f = [system.diagnostics.fileversioninfo]::getversioninfo <<<< ("MSDE2000A.exe")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

Every file I’ve checked has the sames result. However, if my path is c:\windows\notepad.exe (as in the example) it works as expected. What’s going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:29:52+00:00Added an answer on May 13, 2026 at 6:29 am

    .NET and PowerShell’s notion of current directory aren’t always the same. Try passing in the absolute path.

    [Diagnostics.FileVersionInfo]::GetVersionInfo('C:\Windows\System32\user32.dll')
    
    ProductVersion   FileVersion      FileName
    --------------   -----------      --------
    6.1.7600.16385   6.1.7600.1638... C:\Windows\System32\user32.dll
    

    Also, you can get this information with Get-ChildItem like so:

    Get-ChildItem C:\Windows\System32\user32.dll | fl VersionInfo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now, I'm trying to use a Powershell script to read through a text
I'm trying to use powershell to configure the account credentials, but I need to
I' trying to use a Linq query to find and set the selected value
I trying to use ImageInfo and Jython to get information from a image on
I'm trying to modify the contents of an MSI file using Powershell. To do
I am trying to replace a sentence in .config file using powershell. ${c:Web.config} =
I am trying to use PowerShell do a simple find and replace. I use
I'm trying to use the PowerShell Add-Member cmd on all the items in an
I am trying to get PowerShell to give me the RAM and CPU usage,
When trying to use i18n in rails I get the following undesired output. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.