Find entire path to program on Windows command line

1137015 pts.
Tags:
Command line
Linux
Microsoft Windows
Our department has had a ton of path problems lately. One of our CMD scripts is hidden (usually by another program). Is there a way I can find the entire path to a program through the Windows command line? Something like the WHICH Linux command.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    Most people would simply do a search for the file name using the Windows Search tool. Is there a reason that can't be done?

    From a Windows command line, you might do something like this:
       cd\ && dir desktop.ini /s
    The initial "cd\" gets you out of the current directory and puts you at the drive root. (Specify a drive letter if you need to change drives.) You don't need the cd command if you're already at your search starting point.

    The "dir" command does the search. In this case it searches for a file named "filename.ext". Use the actual filename of your file. The "/s" causes the search to look into subdirectories  below your starting point.

    The "&&" tells Windows to the second command only if the first command doesn't fail. You might use just "&" if you want the second command to run no matter what.

    In a complex drive directory structure, the commands might take a minute or two to complete.
    34,430 pointsBadges:
    report
  • TheRealRaven
    That should be edited to correct a typo or two, but this site doesn't seem to allow edits of comments for some unknown reason. You can probably figure out any mistakes. If not, just ask.
    34,430 pointsBadges:
    report
  • ToddN2000
    Thanks for the tip Raven. I rarely use the DOS command window. And yes, I hate it too that we cannot edit our own posts after they are made. :(
    131,550 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: