This is an example of how to do this:
@echo off
:action
echo File size of currently running batch file: %~z0
goto eof
:eof
echo Press a key to quit...
pause > NUL
goto blackhole
:blackhole
Using %~z0 retrieves the file size of the currently running batch which should be 164 (unless of course you have added in or removed extra line breaks, comments, etc.)
One reason to use file size would be, for instance, you might want a batch to once use a given configuration file, but then use another the next time, and then to switch back to the first the time after that. If these configuration files are definitely of different size, you can use file size to operate the swap.
Voilà!
Thoughts?
No comments:
Post a Comment