how create a .bat file that deletes a file on remote server?
NickName:newbie Ask DateTime:2011-06-23T01:45:17

how create a .bat file that deletes a file on remote server?

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

More about “how create a .bat file that deletes a file on remote server?” related questions

how create a .bat file that deletes a file on remote server?

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...

Show Detail

How to execute a bat file on remote server?

I have two physical machine. The first machine want to execute a bat file on the second machine. I create a share location on the second server and tried to run it from the first machine and it doe...

Show Detail

Run a Bat file in remote server without prompting for password

I have 2 windows servers (Let's say Server1 and Server2). On Server2 there is a batch file server2.bat. I need to execute that batch file on Server2 from Server1. Hence I have created a remote_run....

Show Detail

How to execute .bat file in PHP from remote server?

I am trying to execute following code in PHP. It runs, but returns the result of my local system, where I need the bat file should run on remote system. if( pclose(popen("cmd /c "."\\\\ServerName\...

Show Detail

I can not start .bat file on the remote server

I can not start .bat file on the remote server, which should start services if they are disabled. The file runs only on the local computer. @echo off sc query "$Servicename$" | find /i &...

Show Detail

Executing a Remote Bat File from A Remote Server

Want to do something like this but only returns the string of the scriptblock and no output. How would I get this bat file to execute and produce the desired output csv file? Invoke-Command -

Show Detail

Bat File wait for remote input

is it possible to make a bat file that waits for a remote command that is cross-domain? that way I can set up a bat file on my computer at home that clicks accept (for chrome remote desktop) when I...

Show Detail

Create a bat file with variables from another bat file

I want to create a bat file with set variables from another bat file. This is for a startup .bat file that maps network drives and copies some files to the local computer and looks at the system se...

Show Detail

run .bat file on remote machine

I try to run .bat file on remote machine. From my machine i mapped the folder where my .bat (on the remote machine) is exist and from my machine i just try to run the file: os.system(r'‪Y:\file.b...

Show Detail

How to create a .BAT file to download file from HTTP\ftp server?

How to create a .BAT file to download file or folder from FTP server? (and replace with it existing file) (we have links like ftp://me:[email protected]/file.file (or http://example.com/file.file)...

Show Detail