Search found 2 matches

by collector00
09 May 2016 14:44
Forum: DOS Batch Forum
Topic: Embedding IF inside FOR statement
Replies: 4
Views: 4614

Re: Embedding IF inside FOR statement

Do not use labels like if they were comments! FOR /L %%A IN (%firstYear%,1,%lastYear%) DO ( SET tFileCur=my_filename%%A.xls IF EXIST "%foldernm%\!tFileCur!" ( ECHO. Processing: !tFileCur!... found. SET /a repCount=repCount+1 REM move to todays folder MOVE /Y "%foldernm%\!tFileCur!&qu...
by collector00
09 May 2016 09:00
Forum: DOS Batch Forum
Topic: Embedding IF inside FOR statement
Replies: 4
Views: 4614

Embedding IF inside FOR statement

Hi, I have the following script that I'm trying to run (this is just a subsection of it where the issue exists). Basically, I receive 4 files -- one for 2016, 2015, 2014 and 2013. The script, in this instances, simply moves that file (for that year) to a folder that corresponds to the date. Rather t...