Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 183271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:05:10+00:00 2026-05-11T15:05:10+00:00

Basically, I have this code: DirectoryInfo dir = new DirectoryInfo(@\\MYNETWORK11\ABCDEFG\ABCDEFGHIJKL\00806\); FileInfo[] files = dir.GetFiles(200810*);

  • 0

Basically, I have this code:

DirectoryInfo dir = new DirectoryInfo(@'\\MYNETWORK11\ABCDEFG\ABCDEFGHIJKL\00806\'); FileInfo[] files = dir.GetFiles('200810*'); 

I expect it to match any files starting with 200810. However, it’s matching files named

20070618_00806.bak and 20070817_00806.bak (the stars aren’t in the filename, that was the only way I could include the underscore)

I tried it with dir from a command prompt, and it matches those files also. Why?

Edit:

Maybe using C: as the example was not a good thing. The directory I’m actually querying is a network share \\MYNETWORK11\ABCDEFG\ABCDEFGHIJKL\00806\

If checking against the short name has anything to do with it, won’t 20070817_00806.bak be 200708~1.bak? That doesn’t match either

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:05:11+00:00Added an answer on May 11, 2026 at 3:05 pm

    msdn states that

    ‘Because this method checks against file names with both the 8.3 file name format and the long file name format, a search pattern similar to ‘*1*.txt‘ may return unexpected file names. For example, using a search pattern of ‘*1*.txt‘ will return ‘longfilename.txt‘ because the equivalent 8.3 file name format would be ‘longf~1.txt‘.’

    Could this be the cause?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

let say I have this code Map<String, String> list = new HashMap<String, String>(); list.put(number1,
I have some code that I wrote to basically clear out the directory every
I have this code in .bat file FOR /F tokens=* delims= %%G in (partners.txt)
I have this code: <div id=menu> <ul> <li><span id=menulabel>Your Languages</span></li> <?php $hotClass = '';
At the moment I have this code: $rawsql = SELECT * FROM numbers n
I dont have time right this second to put some sample code, (Ill edit
I wonder why IE doesn't seem to recognize the width I specify? Basically I
I'm a bit naive when it comes to bitwise logic and I have what
I'm working on a little part of my program, handling the input, basically I
i am leveraging this project to use jqgrid to filter and sort collections .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.