# Bat to test existance of a file on list of computers and copy new file.



## Resarfski (Mar 2, 2011)

Hi All

I'm trying to write a bat file to ...

1. Interrogate several computers, listed in a .txt file (currently contains 3 hosts for test purposes)
2. Check for the instance of a specific file (indicating the installation of a specific application)
3. If the file doesn't exist, comment to that effect.
4. If the file exists, overwrite it with an amended file (without user response).
5. Send the results of the bat file operations to a separate log file.

The code I'm using is 


```
FOR /F %%a IN (C:\FraserDATA\BATs\LispProblems\ComputerList.txt) do (
IF EXIST "c$\Program Files\AutoCAD Architecture 2010\Support\acad2010doc.lsp" GOTO COPY_FILE
echo File doesn't exist
echo.
echo [URL="file://%25%25a/"]\\%%a[/URL] ##################
echo.
) >>C:\FraserDATA\BATs\LispProblems\FileCopied.txt
:COPY_FILE
COPY C:\FraserDATA\BATs\LispProblems\acad2010doc.lsp "[URL="file://%25%25a/c$/Program"]\\%%a\c$\Program[/URL] Files\AutoCAD Architecture 2010\Support\" /y
 
pause
```
The only result I'm getting is "File doesn't exist" for each computer entry (one has the requiste folder/file entry).

Anyones help or guidance would be very much appreciated.


----------



## Resarfski (Mar 2, 2011)

I was really hoping for some help with this batch file


----------

