0

I have a requirement to run a particular .bat file on multiple servers.

I am currently using:

psexec -s @c:\list.txt -c c:\copy.bat /user:Domain\userName -p %PasswordVariable% -d

I am getting error such as:- Error copying c:\copy.bat to remote system: The file exists.

Please note that file never exists.

Am i doing anything wrong?

list.txt has multiple server names and to access say for example \server1\c$ - username password is required. Does that creating problem while copy? But i have given the username and password in psexec command itself.

Carlos Landeras
  • 11,025
  • 11
  • 56
  • 82
kino
  • 11
  • 2
  • 6

2 Answers2

2

use psexec "-c -f" or "-c -v" qualifiers

-1

Check the windows\system32 directory for that file. Usually, psexec copies the file into that path. Use the -f option to ovwrwrite the batch file if it already exists

frank
  • 1