I am pretty new to .bat file concept. I have this daily admin task to remotely login on a server and delete the log file. I created a delete.bat
file which deletes the desired log file but it works only when it is located locally on that server. If I use the same code (del D:\Logs1\Logs2\a.txt /p
) on my local machine and schedule (using at 13:22 \\abc.xyz.com /every:m,t,w,th,f,s,su delete.bat
) to run on remote server, it gives me an error that "the network path was not found".
I searched various websites but couldn't find anything, and if I find something, it's highly VB or some other programming language based solution which I don't understand much.
Any help would be great and thank you in advance.
Copyright Notice:Content Author:「newbie」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/6444205/how-create-a-bat-file-that-deletes-a-file-on-remote-server