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 want to look for all .txt files in a folder, which their filename starts with r and is 4 character length or lower (<=4)

What's the query? (in Windows XP)

share|improve this question
1  
I'm guessing that powershell is not allowed since it is homework? –  EBGreen May 3 '13 at 17:56

1 Answer 1

r???.txt will work. The question marks represent each character so it will match all txt files starting with r with up to 4 characters.

OR

PowerShell
get-childitem c:\ -r r*.txt |? {$.GetType().Name -match "File" } |? {$.basename.length -le 5} | %{$_.name}

share|improve this answer

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.