Finding a .exe file on multiple remote computers

Answered Finding a .exe file on multiple remote computers

  • Friday, November 16, 2012 5:25 PM
     
     
    Is there a batch file I can run that will tell me whether or not a .exe file exists. I would like to run this on multiple computers and have it send Yes - No results to a txt file.

All Replies

  • Friday, November 16, 2012 6:09 PM
    Moderator
     
     
  • Friday, November 16, 2012 6:32 PM
     
     

    I have created a batch file that appears to work on my local PC. When I run the file remotely with PSEXEC the results come back and say the file that i'm looking for doesn't exist. I know the file exists because i placed a test document on the computer i'm searching. Below is the batch file. Please take a look and any advice would be appreciated.

    @echo off
    If exist c:\test echo %COMPUTERNAME% yes >> \\servername\location\test.txt
    If NOT exist c:\test echo %COMPUTERNAME% no >> \\servername\location\test.txt

  • Friday, November 16, 2012 7:42 PM
    Moderator
     
     

    Hi,

    Why not just use a UNC path for remote computers?

    Bill

  • Friday, November 16, 2012 8:48 PM
     
     
    I will need to use PSEXEC to scan multiple PC's on the network for the particular .exe file. I didn't think I could use a UNC path for this?
  • Friday, November 16, 2012 9:15 PM
    Moderator
     
     
    I will need to use PSEXEC to scan multiple PC's on the network for the particular .exe file.

    Why?

    Describe your goal, not the steps.

    Bill

  • Friday, November 16, 2012 9:25 PM
     
     
    We have a proprietary software that could be in any of 3 install locations depending on the operating system. I would like to compile a list of computer names that the .exe resides on. I will need to run whatever script on every computer (about 500) on my network. I'm open to suggestions on how to obtain this if my way seems inefficient.
  • Friday, November 16, 2012 9:39 PM
    Moderator
     
     Answered

    Why does the executable's directory location matter?

    It sounds like your actual question is: How do I determine if a particular software is installed?

    I wrote a PowerShell script a while back than can can the current computer (or one or more remote computers) for installed software:

    Auditing 32-Bit and 64-Bit Applications with PowerShell

    Note: Only the computer from which you run the script has to have PowerShell. The remote computers do not have to have PowerShell installed or WinRM remoting enabled. (The script reads the registry.)

    Bill