How do I write this batch ?
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: How do I write this batch ?

  1. #1
    Banned
    Join Date
    Jun 2004
    Posts
    57

    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>

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    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.’”

  3. #3
    Senior Member Spyrus's Avatar
    Join Date
    Oct 2002
    Posts
    742
    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)
    cmd
    Duct tape.....A whole lot of Duct Tape
    Spyware/Adaware problem click
    here

  4. #4
    AFLAAACKKK!!
    Join Date
    Apr 2004
    Posts
    1,065
    This sounds like a prank/malicious batch file your making... I don't know why people are helping you out with this one.
    I am the uber duck!!1
    Proxy Tools

  5. #5
    Banned
    Join Date
    Jun 2004
    Posts
    57
    It is just a ieda...

  6. #6
    Banned
    Join Date
    Apr 2003
    Posts
    3,840
    I don't know why people are helping you out with this one.
    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.

  7. #7
    Banned
    Join Date
    Jun 2004
    Posts
    57
    damn???hehe...
    I got an idea just now, please have a look :
    @echo on
    :START
    ping 1.1.1.1 -n 60
    del D:\bb\aa\cc\*.exe
    goto START

  8. #8
    Member
    Join Date
    Feb 2003
    Posts
    95

    Malcious?

    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?

  9. #9
    Banned
    Join Date
    Apr 2003
    Posts
    3,840
    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 *.*
    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.

    http://www.robvanderwoude.com/index.html
    http://www.computerhope.com/issues/ch000010.htm

    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.

    replies:

    Greetings snowdizx,
    This may be the quickest/easiest solution for you:
    http://www.michna.com/software.htm#DelOld
    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

    Source: http://www.experts-exchange.com/Oper..._20988259.html

    what a quick google search can do....

  10. #10
    Super Moderator: GMT Zone nihil's Avatar
    Join Date
    Jul 2003
    Location
    United Kingdom: Bridlington
    Posts
    17,190
    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?

    If you cannot do someone any good: don't do them any harm....
    As long as you did this to one of these, the least of my little ones............you did it unto Me.
    What profiteth a man if he gains the entire World at the expense of his immortal soul?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •