June 2nd, 2004, 06:14 AM
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.’”
June 2nd, 2004, 06:33 AM
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..
June 2nd, 2004, 06:39 AM
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.
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.
June 2nd, 2004, 06:43 AM
Although I couldn't understand exactly, thx for all help,
and somebody give this ,have a look please:
if '%1'=='' goto Usage
set /a delay=%1
set /a delay=%delay%-1
if %delay% GTR 0 goto delay
echo Use %0 DelayTime
June 2nd, 2004, 11:22 AM
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.
June 2nd, 2004, 02:33 PM
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.