|
Answer» Hi Friend,
ACTUALLY I NEED to process all the files from a folder as one by one...., Let me explain the scenerio in detail....
For example a Folder "collection" CONTAINS several number of file (vary to time). I need to process all the available files (one by one). Process in the sense I will be validating certain things and I will save it in some other location.
Is there is any way to recolve this issue in DOS? If so will you please help me to trigger out the same....,
Thanks, Vinoth R We have done this countless times. I'm very surprised that your site search didn't turn up anything
Code: [Select]for /f "tokens=* delims=" %%v in ('dir /a:-d "c:\collection"') do ( . . Your code goes here . )
There are many variants of the for instruction. We would need more specifics to give you a definitive answer.
Good luck.
Hi Friend,
With reference to your above SUGGESTION...., How I can fetch the first file in the directory (In first execution) and fetch second file (In second excecution)....., Where the files name will be stored....,
Thanks VinothI may have been a bit hasty in posting the code. I left out a switch on the dir command:
Code: [Select]for /f "tokens=* delims=" %%v in ('dir /a:-d /b "c:\collection"') do ( . . Your code goes here . )
The file name is stored in the %%v variable. With each iteration of the loop, the %%v variable takes on a new VALUE. The for loop is self contained and will end when there are no new values for %%v to process (in this case, when there are no more files in the dir listing).
Code: [Select]for /f "tokens=* delims=" %%v in ('dir /a:-d /b "c:\collection"') do ( echo %%v )
Check out the dir command, there are switches you may find helpful.
Good luck.
|