Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .