title: Batch file to search list of PCs for a folder/file and create log file
body: <p>I am trying to get a script to seach all the pcs on my network and tell me if a folder is present within the C directory.</p>
  
  <p>Here's the script I've got so far, it is working but it is not pulling through the list of PCS from the file specified.. It is always running on my PC alone.</p>
  
  <pre><code>@ECHO OFF
  
  for /f %%a in (c:\pcs.txt) do IF EXIST "C:\HMSJAVA\jt400.jar" (
  echo %computername% has HMS GUI locally installed. &gt;&gt; "c:\hmsguipcs.txt"
  GOTO :END
  ) ELSE ( Goto :NoHMS
  )
  
  
  :NoHMS
  IF NOT EXIST "C:\HMSJAVA\jt400.jar" (
  echo %computername% does NOT have HMS GUI locally installed. &gt;&gt; "c:\hmsguipcs.txt"
  GOTO :END
  )
  
  :END
  PAUSE
  
  
  *****MY PCs File pcs.txt*****
      COMPUTER1
      COMPUTER2
      COMPUTER3
  </code></pre>
  
  <p>Got it working, what I did was add the for /f command to the if not exist command, and then ran the batch using psexec. I also had to change all teh stuff specific to the C drive to our public shared drive. Works like a charm now!</p>