How do I write this batch ? - Page 2
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: How do I write this batch ?

  1. #11
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    nihil you can do that with a bat. when you want it to stop you just ^c
    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.’”

  2. #12
    Senior Member therenegade's Avatar
    Join Date
    Apr 2003
    Posts
    400
    It did kinda sound like he wanted to delete a file off a remote system,and nihil...I think that the exe bit's just an example..and why would you want to drive your bat file into an infinite loop Tedob1?for deleting a directory anyways...beats me..

  3. #13
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,324
    The idea for this does sound a bit off... but I just wanted to add...

    If you are trying to delete all the files in a certain directory over a specific period of time, and those files are in use at the time... your batch script will error out... I *think*. I haven't tried it. I remember having that problem with some of my batch files a while ago.

    Spyrus was right though. You can use sleep to "pause" your the script for that time.
    Then just loop it like you were.

    I beleive that sleep.exe comes with the resouce kit?

    If he wanted to delete files off of a remote computer... all that he'd have to make sure of is:
    1. Have appropriate credentials with permission (Filesystem ACLs).
    2. Have a drive mapped to a share that includes the folder/files to be deleted.

    I do it all the time....

    Personally, I use the task scheduler to run my batch files though. They are only run in the middle of the night when I need update certain files... I'm not looping like you are and I know that those files are not in use at the time.
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

  4. #14
    Banned
    Join Date
    Jun 2004
    Posts
    57
    Although I couldn't understand exactly, thx for all help,
    and somebody give this ,have a look please:
    :elay@Batch
    @echo off
    if '%1'=='' goto Usage
    set /a delay=%1
    :delay
    set /a delay=%delay%-1
    if %delay% GTR 0 goto delay
    goto :eof
    :Usage
    echo Use %0 DelayTime

  5. #15
    Custom User
    Join Date
    Oct 2001
    Posts
    503
    eh??? Maybe tomyahoo was attempting to set the timeout period of the ping command and then delete the file, making ping timeout after 60 seconds...you never know. If it was pinging an ip that didn't exist at the time then that would work to make the program sleep. lol...what a method :P

    Sleep's the most obvious one though. Doesn't it come with XP? I'm sure it came with all the win9x releases.

    I know this isn't strictly related to this thread, but I made a nice wee script to detect new connections using netstat on my linux box. Unfortunately it's a bit limited, but seems to work. It involves dumping the output of netstat to a file and then a while later dumping it to another file then comparing the two files and outputting any differences.

    anyhow...enough blethering.

    ac

  6. #16
    Super Moderator: GMT Zone nihil's Avatar
    Join Date
    Jul 2003
    Location
    United Kingdom: Bridlington
    Posts
    17,191
    Gothic~

    The XP command is "delay" n Seconds

    I still don't understand pinging a static IP address 60 times, particularly in an infinite loop like he had at first..........that could be taken as a DoS attack?

    I also don't understand "*.exe"..............that would select all . exe files in the path? And if you don't want .exes, why install them in the first place.

    Why do it more than once? they won't come back of their own accord. If they are being used you will get an error unless they are programs that load into memory, in which case the system will produce error messages on the next reboot?

    I could just about understand clearing system generated temporary files to save space, but you would have to wait for the programs using them to finish with them or you would most likely get an error, as they will be object locked?

    If you want to do it from a security viewpoint you would need some sort of overwriting algorithm anyway?

    Tomyahoo, can we see your PROGRAM SPECIFICATION. What is it you are trying to do / achieve?

    I am afraid you will not get much help until we understand the objectives of the program.

    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
  •