Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm developing a batch file within which I'm using the following pattern:

*.res

I want to select all files with the extension .res, but this pattern is matching files with an extension of .resources also.

In other words, it acts like I'm specifying *.res* but I'm not.

Is there a way I can prevent the command line from evaluating short 8.3 filesnames?

share|improve this question
    
There is a registry option to disable this globally. –  Hello71 Aug 23 '10 at 21:27
    
I found a way to disable the generation of short file names: support.microsoft.com/kb/210638 Is this what you are referring to? It doesn't appear to affect existing short file names, however. –  Avalanchis Aug 24 '10 at 14:30
add comment

1 Answer

up vote 2 down vote accepted

You'll have to iterate manually and exclude those files that don't match, for example like this:

for %%f in (*.res) do if [%%~xf]==[.res] (
    rem do something with %%f here
)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.