1.

Solve : Batch files help!?

Answer»

I need some help with a batch file I need to write, I am TRYING to do the following. I need to find all the files in location A with a file size of 0KB and replace the text in those files with an ERROR message saying something like "error when saving", and to add a little more complexity I need to skip over .red files. Thanks for any helpWhat do you have so far?Good question, Gurugary.
just what I found from searching this site, I don't really understand it though and it is not doing all it needs to be.
FOR %%F IN (*.*)DO (
IF %%~zF LSS 1 DEL %%F
)

ThanksOK, well you have something.  But it looks like this CODE is meant to delete files, not change their contents.  Have your got your FOR loop working?  And INSTEAD of DEL, do do some research on console redirection and the '>' symbol.  You should be able to replace the DEL command with your redirection.  Once you have that working, then we can work on skipping .red files



Discussion

No Comment Found