CalmSoul
asked on
batch file to check for file in all folder
How can I check if "results.txt" exist in all sub folder under "C:\folder\results\"?
I.e. each subfolder has to contain results.txt, and you want to see which one does not?
ASKER
Yes
for /F "tokens=*" %%F in ('dir /a:d') do if not exist %%F\results.txt echo %%F
Should give the starting folder, too, and do all folders, of course:
for /F "tokens=*" %%F in ('dir /a:d /s /b C:\folder\results\') do if not exist %%F\results.txt echo %%F
for /F "tokens=*" %%F in ('dir /a:d /s /b C:\folder\results\') do if not exist %%F\results.txt echo %%F
ASKER
So what is the output? I only want those folders list which doesn't contain results.txt
Try it ... It should do exactly that. If you want to try it on command line (outside of a batch file), you have to replace %% by %.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
getting message "d" was unexpected at this time
Did you copy the code exactly as-is?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry??? That solution is just an expansion of mine.
ASKER
sorry i got confuse... I should have split points
CalmSoul
I'm quite happy for you to summon a moderator to re-open this question providing you ACCEPT my code as the solution (as you have done above) and award Qlemo ASSISTED in the solution. I will agree to a 50/50 split in points. Finally, a grade 'A' would ensure we get the 'full' points awarded.
To summon a moderator: click on "Request Attention" (bottom right near red icon of your question above)
I'm quite happy for you to summon a moderator to re-open this question providing you ACCEPT my code as the solution (as you have done above) and award Qlemo ASSISTED in the solution. I will agree to a 50/50 split in points. Finally, a grade 'A' would ensure we get the 'full' points awarded.
To summon a moderator: click on "Request Attention" (bottom right near red icon of your question above)
In my previous post, I stated quite clearly I was happy for you to re-open this question and award points to Qlemo however, I did stipulate 3 conditions. These were:
(1) you "ACCEPT" my code as the solution, and award "ASSISTED" in the solution to Qlemo
(2) a 50/50 split in points
(3) a grade 'A'
While you satisfied (2) and (3), you did NOT "ACCEPT" my code as the solution. I have been awarded points on the basis that I only "ASSISTED" in the solution.
This is unfair as it was in good faith that I agreed for you re-open this question.
(1) you "ACCEPT" my code as the solution, and award "ASSISTED" in the solution to Qlemo
(2) a 50/50 split in points
(3) a grade 'A'
While you satisfied (2) and (3), you did NOT "ACCEPT" my code as the solution. I have been awarded points on the basis that I only "ASSISTED" in the solution.
This is unfair as it was in good faith that I agreed for you re-open this question.
ASKER
Ohh you want accepted and his assited?
If that is the case reopen the question I will do that... I am rookie is accpet multiple solutions
If that is the case reopen the question I will do that... I am rookie is accpet multiple solutions
CalmSoul
When you close a question you are given the option of accepting multiple comments as your solution.
The first comment you should click on is the one which you select as your ACCEPTED solution then after, you select others as ASSISTED in that solution.
I fear, because Qlemo's solution appears chronologically before mine, you clicked on that one first then proceeded to click on mine and this is why the ACCEPTEDB and ASSISTED are in the order as they are.
When you close a question you are given the option of accepting multiple comments as your solution.
The first comment you should click on is the one which you select as your ACCEPTED solution then after, you select others as ASSISTED in that solution.
I fear, because Qlemo's solution appears chronologically before mine, you clicked on that one first then proceeded to click on mine and this is why the ACCEPTEDB and ASSISTED are in the order as they are.
Sorry, didn't realise off topic was remmoved due to not refreshing my browser before posting.
WhackAMod
Why won't you allow me to make general comments to Qlemo? I'm not breaking any rules. I'm not going off on a rant. I'm not using unacceptable tone. Please allow me the freedom to post messages. If I am doing something wrong them please say so otherwise it appears you are spiting me.
Why won't you allow me to make general comments to Qlemo? I'm not breaking any rules. I'm not going off on a rant. I'm not using unacceptable tone. Please allow me the freedom to post messages. If I am doing something wrong them please say so otherwise it appears you are spiting me.