Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By sathya11491

Thread: Finding program path

  1. #1
    sathya11491 is offline Member
    Join Date
    Mar 2012
    Posts
    12
    Rep Power
    0

    Default Finding program path

    hi guys,

    consider a process for e.g. firefox.exe

    i need to find the path of the process i.e. the installed directory

    i know it is in C:\Program files\firefox\firefox.exe but how to find it via a java program?

    or is there any windows command to find it?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,449
    Rep Power
    25

    Default Re: finding program path

    You could use the File command and its methods to open all directories and look at all the files in each directory until you find the one you want.

    This thread move to "New to Java"

    I can't see anything relating to Networking here.

  3. #3
    noobplus's Avatar
    noobplus is offline Senior Member
    Join Date
    Feb 2012
    Location
    chennai,south of India(south east of asia)
    Posts
    232
    Rep Power
    3

    Default Re: Finding program path

    Quote Originally Posted by sathya11491 View Post
    hi guys,

    consider a process for e.g. firefox.exe

    i need to find the path of the process i.e. the installed directory

    i know it is in C:\Program files\firefox\firefox.exe but how to find it via a java program?

    or is there any windows command to find it?
    your question is "what is the path of a running process"
    for Windows XP,
    Windows has bought a process explorer
    http://download.sysinternals.com/Fil...ssExplorer.zip
    here when u hover the process, it shows the process location in ur hard disk
    for Vista, in task manager, under "processes" tab,u can directly right click "firefox.exe" and click "open file location"

    regards
    dhilip
    Last edited by noobplus; 03-17-2012 at 02:02 PM.

  4. #4
    sathya11491 is offline Member
    Join Date
    Mar 2012
    Posts
    12
    Rep Power
    0

    Default Re: Finding program path

    guys i found another way: use 'wmic' command

    wmic process where name="firefox.exe" get executablepath,commandline
    noobplus likes this.

Similar Threads

  1. Help with finding CLI program
    By russb87 in forum Forum Lobby
    Replies: 0
    Last Post: 06-24-2011, 04:22 PM
  2. Finding path to my command line tools from Java
    By paulanon in forum New To Java
    Replies: 1
    Last Post: 04-07-2011, 02:34 AM
  3. Replies: 0
    Last Post: 01-25-2011, 05:37 AM
  4. Replies: 2
    Last Post: 07-30-2007, 08:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •