0

I have created a batch file using PsExec to run batch files on different PCs. This 'master' batch runs PsExec on 14 remote PCs. However, for some reason, it doesn't always work on a few PCs. Sometimes it does, and sometimes it does not. I have tried to debug by making changes in my anti-virus firewall settings, and that seems to have fixed the problem in one such PC, but not the other one. This issue only appears to be for these PCs. The code is the same for all the PCs:

psexec -i 1 -h -d \\(pc name) -u (username) -p (password) "(batch name).BAT"

There is also a code in the beginning which asks if the user is sure they want to run the batchfile, but I don't think that is the reason for this issue.

SET /P AREYOUSURE=Are you sure (Y/[N])? IF /I "%AREYOUSURE%" NEQ "Y" GOTO END

2
  • Your issue contains to little information to be able to give you an answer. First, did you copy the .bat file to the remote machine before executing it? Could it be that the copy of the file was unsuccessful? What is the output from the psexec and does it indicate any useful error message?
    – Marko
    Commented Jan 25, 2023 at 6:39
  • Yes, the .bat file is present in the remote machine. The copy of the file is not unsuccessful - it runs when activated manually. The psexec starts different apps on the remote PC. The only error message that appears is in the CMD of the host PC when the batchfile is activated, which says that remote connection was unsuccessful. Commented Jan 26, 2023 at 9:29

0

You must log in to answer this question.

Browse other questions tagged .