I am having an issue when trying to execute a batch file on a remote machine. Basically I have around 300 servers that I have copied a batch file to that I need to run. The batch file uses xcopy to copy files to other PC's on that servers domain.
I have created a file copy script that copies the batch file from my machine to the servers. That part works as expected and copies the batch file to my specified location...
I then created another task which runs a batch file that tries to execute the batch file I have copied to the servers. This is where I have issues. It seems that the batch file does run but the LANDesk scheduled task returns as failed. Also it doesn't complete the xcopy as expected.
I have put some error handling in the batch file I use to execute the remote one. I have used things like:
if exist C:\CopyUp.bat echo BLAH BLAH BLAH !!!! THIS WORKED >> YUP.DAT
if not exist C:\CopyUp.bat echo BLAH BLAH BLAH !!!! THIS WORKED >> NOPE.DAT
In some cases I have found that the YUP.DAT & NOPE.DAT file is created meaning the batch file ran but the xcopy does not work. When I run the batch file manually on one of the servers the xcopy works and the files are moved as expected.
Long story short I am hoping someone can help me out as there may be another way to execute this batch file on a remote machine.