Search found 4 matches

by WimSKW
29 Aug 2012 05:47
Forum: DOS Batch Forum
Topic: Re: Surprising DIR results when using wildcard
Replies: 6
Views: 5040

Re: Surprising DIR results when using wildcard

I created a few test files and tried it... D:\>dir d:\test\*.xml Volume in drive D is Data Volume Serial Number is C6F9-6F22 Directory of d:\test 29/08/2012 09:45 68 FILE_20120802_yoab_001.xml_bak 29/08/2012 09:46 75 FILE_20120801_apgh_005.Xml_BAK 29/08/2012 09:46 75 FILE_20120801_apgh_005.Xml 29/08...
by WimSKW
28 Aug 2012 07:06
Forum: DOS Batch Forum
Topic: Re: Surprising DIR results when using wildcard
Replies: 6
Views: 5040

Re: Surprising DIR results when using wildcard

[mod edit] Split Topic Surprising DIR results when using wildcard Now that we know where this behaviour comes from, is there a way to work around it? I have a folder with "*.XML" and "*.XML_Bak" files. I wanted to loop over all "*.XML" files like this: for %a in ("...
by WimSKW
24 Aug 2012 09:54
Forum: DOS Batch Forum
Topic: Capture return code of command executed by FORFILES
Replies: 3
Views: 7665

Re: Capture return code of command executed by FORFILES

Thanks for your quick answer. I tried what you suggested: FORFILES /M %strFileFilter% /D %strDateFilter% /c "cmd /c call \"%~f0\" :DoTheWork @ISDIR \"@PATH\" %iFrom% %iLen% && ECHO.0>%temp%\res.txt || ECHO.1>%temp%\res.txt " SET /p ExitCode=<%temp%\res.txt and i...
by WimSKW
24 Aug 2012 06:36
Forum: DOS Batch Forum
Topic: Capture return code of command executed by FORFILES
Replies: 3
Views: 7665

Capture return code of command executed by FORFILES

Hi, I'm using FORFILES to loop over a directory and move the containing files to a subdirectory based on a part of the filename. The FORFILES line is as follows: FORFILES /M %strFileFilter% /D %strDateFilter% /c "cmd /c call \"%~f0\" :DoTheWork @ISDIR \"@PATH\" %iFrom% %iLen...