Computing.Net > Forums > Programming > Batch Freezes

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch Freezes

Reply to Message Icon

Name: stroke6463
Date: June 26, 2006 at 16:40:54 Pacific
OS: XP SP2
CPU/Ram: idk
Comment:

I made a batch that freezes on the line FOR and will stay there forever. If I press 'Control-C', it asks if I want to terminate the program. If I type 'n' to not terminate it, the batch continues. Any ideas? Thanks.


REM Delete Last Years Files
@echo off

for /f "tokens=*" %%A in ('dir /b f:\*.* /s /a-d') do (Call :test %%A)

:test
set file=%*
del c:\progs\temp.txt
del c:\progs\temp2.txt
for /f "tokens=3 delims=/ " %%A in ('dir "%file%"') do (echo %%A >> c:\progs\temp.txt)
findstr /n . c:\progs\temp.txt > c:\progs\temp2.txt
for /f "tokens=2 delims=:" %%A in ('findstr /b "4:" c:\progs\temp2.txt') do if %%A lss 2006 echo %file% >> delete.txt
)



Sponsored Link
Ads by Google

Response Number 1
Name: stroke6463
Date: June 26, 2006 at 18:12:22 Pacific
Reply:

Nevermind, I redirected the dir to a text file and it created a 500MB text file just for the files on F:. It was just taking a really long time. Thanks anyway.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch Freezes

batch File www.computing.net/answers/programming/batch-file/4840.html

batch start n.exe how close during? www.computing.net/answers/programming/batch-start-nexe-how-close-during/17437.html

Batch file to count a specific character in a www.computing.net/answers/programming/batch-file-to-count-a-specific-character-in-a/19751.html