June 2nd, 2004, 03:15 AM
How do I write this batch ?
just what I think,any reply ,thx~~
I want to delete some file automaticly every two minutes..
such as, every two minutes,delete a file a.exe in d:\aa\bb\cc>
June 2nd, 2004, 03:41 AM
here's i file i made you that waits for about 120 seconds depending on you machine. just call it from your bat and goto the beginning.
Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”
June 2nd, 2004, 03:44 AM
As malicious as this may sound like you're trying to delete files off someones computer try looking in google for a Microsoft Windows NT 4.0/2000 utility called Sleep.exe, it should be free and you execute it in a batch file as
sleep (interval in seconds)
Duct tape.....A whole lot of Duct Tape
Spyware/Adaware problem click
June 2nd, 2004, 04:37 AM
This sounds like a prank/malicious batch file your making... I don't know why people are helping you out with this one.
June 2nd, 2004, 04:44 AM
It is just a ieda...
June 2nd, 2004, 05:00 AM
becase we share information and besides, a quick google search would have given him a lot more, but these damn newbies are too lazy to do a search and find some information for themselves.
I don't know why people are helping you out with this one.
June 2nd, 2004, 05:02 AM
I got an idea just now, please have a look :
ping 184.108.40.206 -n 60
June 2nd, 2004, 05:42 AM
hmmm, so your making the program ping a certain IP 60 times, then delete a file off your D:\ drive.... smart... then your repeating it all over again? Why?
My interrpertation of your batch file might have been a little bit off (I haven't seen it in a while).. but i think its wrong for what your trying to do. From wat i can tell... your pinging an IP 60 times. I'm not entirely sure what this is supposed to accomplish also, from what i can tell, your deleting a file off of your D:\ drive... I don't believe you can write batch files to delete other peoples files remotely....
Anyone else questioning his motives?
June 2nd, 2004, 05:47 AM
I think what he's trying to do is connect to a remote server( i guess) and then delete a file from the IP's computer......ugh..
[sarcasm]why bother...sending a virus is easier....[/sarcasm]
oh why not, i dont have anything better to do
To suppress the prompting use the deltree command and add the tag /y. Here is an example of how the whole command would look, deltree c:\windows\temp\*.* /y however this does not work in all versions of Windows and or DOS.
If this command does not work we would recommend that you create a batch file with the following source: "echo y | del %1\*.*" (without the quotes) once created, you can type the name of the batch file then the name of the directory that you wish to delete.
To delete all files from a directory, you could use:
DEL will then ask you to confirm that you want to delete all files.
In batch files, this would stop the execution of the batch file and require user interaction, which usually isn't what batch files are intended for.
similar problem to yours
Dear Expert GURU,
I'm needing to set up a simple batch script to run every day to delete old backup files which are older than 7 days. Is there an easy way to do this with windows batch scripting? I have a different task which runs with a 'copy' command however, I can't find a good script to delete old files! Thanks for your help, judging upon how much i 'need' this script quickly, I've allocated 350 points to this question! --Devon D.
This may be the quickest/easiest solution for you:
Specify the file types you want to delete along with the age...
DelOld.exe C:\TEMP\*.* 7
Obsolete is another tool for this: http://users.aol.com/pasacaca/obsolete/obsolete.zip
Or you can try SteveGTR's solution here: http://www.experts-exchange.com/Oper..._20947290.html
what a quick google search can do....
June 2nd, 2004, 06:03 AM
Well I am totally confused.
1. There is no delay instruction, so it will just go into an infinite loop?
2. Why ping an IP 60 times? I would have thought that you either get a positive or negative response? where are the instructions on what to do if you do/don't get a response?
3. If the file to be deleted is really an .exe, why do you need to delete it more than once? It isn't going to re-generate itself is it?