Arghhh! Problem using findstr command under Vista

By LookinAround
Apr 29, 2009
  1. OK. Here's the deal...

    I'm trying to use the findstr command (it's the find string command) in a Vista elevated command prompt window

    Specifically, i enter:
    findstr /c:Friendly /m /i /s /d:c:\Windows  *.inf
    which should
    • Search C:/Windows and all its subdirectories
    • Find all files of type .inf
    • And output the name of every file containg the string "friendly"

    It does run and does output the filenames as i expect but the darn command never terminates! It completes outputing the file names and then continues to keep running until i have to kill it by hand!

    This command works just fine entered exactly the same in an XP command prompt window but not in Vista!

    Anyone know what the problem is????? :confused: :confused:

    P.S. i can see the findstr process still running (using Process Explorer even though it no longer has any file handles open)
  2. kimsland

    kimsland Ex-TechSpotter Posts: 14,524

        Wildcard: any character
        Repeat: zero or more occurrences of previous character or class
    I think the Asterix is causing the issue
    Please test without it to confirm

    It seems "." (as in just a dot without quotes) is the wildcard ie:

    findstr /c:Friendly /m /i /s /d:c:\Windows .inf

    Note I haven't tested this, but would like your feedback
  3. LookinAround

    LookinAround Ex Tech Spotter Topic Starter Posts: 6,491   +183

    Hmmm.. Good idea and has me trying different approaches toward success but not yet

    Here's what i find
    1. As mentioned in last post
      [B]findstr /c:Friendly /m /i /s /d:c:\Windows *.inf[/B]
    Works fine in XP but not so in Vista

    2. I tried your suggestion
     [B]findstr /c:Friendly /m /i /s /d:c:\Windows .inf[/B]
    Returns within 30 seconds with no match

    3. But gives me a thought, so i try
     [B]findstr /c:Friendly /m /i /s /d:c:\Windows "*.inf"[/B]
    Provides same list of directories like in case 1) above and then appears to hang

    4. So decided to next try try with full filename (no wildcard)
      [B]findstr /c:Friendly /m /i /s /d:c:\Windows usbaapl.inf[/B]
    It completes within 30 seconds and correctly returns System32\DriverStore\FileRepository\usbaapl.inf_d9da5e84\usbaapl.inf

    5. Hmm.. so i'm guessing either
    a) The wild card has it hung up on some huge or hidden or permission access related directory that is giving me grief or
    b) The wild card is just gonna make it take a really long time (i have limited remote logon access to a vista machine so haven't tried lettin it run yet for a real long time)

    In any case, will let you know should i figure this out! Thanks for the input :approve:
  4. kimsland

    kimsland Ex-TechSpotter Posts: 14,524

    Long shot, but try ..inf (ie Dot Dot INF)

    Anyway, it's solved it was the asterisk whilst in Vista
    Although you haven't got the command line yet, please do reply once you do :)
  5. LookinAround

    LookinAround Ex Tech Spotter Topic Starter Posts: 6,491   +183

    as an aside.....

    i found another interesting freeware tool.. check out pingplotter (and i've downloaded and used this one before referrin you to it :D )
  6. kimsland

    kimsland Ex-TechSpotter Posts: 14,524

  7. AtK SpAdE

    AtK SpAdE TechSpot Chancellor Posts: 1,495

    How effectively does it map something out? It seems worht the money if it does a good job. You can count hops by pinging it. Unless they dont allow ICMP in which case does this work?
  8. LookinAround

    LookinAround Ex Tech Spotter Topic Starter Posts: 6,491   +183

    Umm.. if ICMP isn't allowed then ping itself doesn't work! And if ping doesn't work none of the standard net diagnostic tools (ping, pathping, or traceroute) will work as they all rely on ping. (As does this freeware tool, pingtool)

    But assuming ping is working then pingtool gives not just hopcount but a quick visual / graphic display of lag between hops so you can see where your network lags are.

    And one should at least be able to ping through gateways up to an ISP. So, for example, kimsland can't ping my public IP address (because i disable ping replies from my router) but you can view the network path and time lags between hops ping takes up to reaching my ISP. (which still supplies lots of good network traffic data between almost but not quite the two end-points)
  9. LookinAround

    LookinAround Ex Tech Spotter Topic Starter Posts: 6,491   +183

    Well, i think there's more then one way to skin a cat (the Vista cat, that is!) :rolleyes:

    I thought of a way to try avoid passing the * (wildcard character) to findstr in Vista.

    If you ever need do the same sometime future, download the strings function from Sysinternals

    I entered
    strings -a -s C:\Windows\*.inf | findstr /i /c:friendlyname
    which appears to work (almost) in at least it now
    • Outputs every line in every inf file under C:\Windows which
    • Matches my string friendlyname and then.........
    • The command string actually terminates! :approve:

    Except (of course, there's gotta be an "except" with Vista!) I now also see a few lines that say things like
    FINDSTR: Line 863931 is too long.
    FINDSTR: Line 863934 is too long.
    FINDSTR: Line 863935 is too long.
    So i think i may at least have a work around plus maybe a clue to the source of the original problem. No more time to work on it now... but will keep you posted
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...