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 3222030
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:56:40+00:00 2026-05-17T15:56:40+00:00

My system has findstr.exe but when I try to execute it, it gives me

  • 0

My system has findstr.exe but when I try to execute it, it gives me the following error

FINDSTR: Bad command line

Tried so many things but unable to fix.
I need to use regex in my batch script.

Any other suggestion?

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-17T15:56:40+00:00Added an answer on May 17, 2026 at 3:56 pm

    You need to at least give it some strings to look for. That error message is the one you get if it doesn’t think you’ve provided a search string (everything else is optional):

    C:\Documents and Settings\Pax> findstr /?
    Searches for strings in files.
    
    FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
            [/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
            strings [[drive:][path]filename[ ...]]
    
      /B         Matches pattern if at the beginning of a line.
      /E         Matches pattern if at the end of a line.
      /L         Uses search strings literally.
      /R         Uses search strings as regular expressions.
      /S         Searches for matching files in the current directory and all
                 subdirectories.
      /I         Specifies that the search is not to be case-sensitive.
      /X         Prints lines that match exactly.
      /V         Prints only lines that do not contain a match.
      /N         Prints the line number before each line that matches.
      /M         Prints only the filename if a file contains a match.
      /O         Prints character offset before each matching line.
      /P         Skip files with non-printable characters.
      /OFF[LINE] Do not skip files with offline attribute set.
      /A:attr    Specifies color attribute with two hex digits. See "color /?"
      /F:file    Reads file list from the specified file(/ stands for console).
      /C:string  Uses specified string as a literal search string.
      /G:file    Gets search strings from the specified file(/ stands for console).
      /D:dir     Search a semicolon delimited list of directories
      strings    Text to be searched for.
      [drive:][path]filename
                 Specifies a file or files to search.
    
    Use spaces to separate multiple search strings unless the argument is prefixed
    with /C.  For example, 'FINDSTR "hello there" x.y' searches for "hello" or
    "there" in file x.y.  'FINDSTR /C:"hello there" x.y' searches for
    "hello there" in file x.y.
    
    Regular expression quick reference:
      .        Wildcard: any character
      *        Repeat: zero or more occurances of previous character or class
      ^        Line position: beginning of line
      $        Line position: end of line
      [class]  Character class: any one character in set
      [^class] Inverse class: any one character not in set
      [x-y]    Range: any characters within the specified range
      \x       Escape: literal use of metacharacter x
      \    Word position: end of word
    
    For full information on FINDSTR regular expressions refer to the online Command
    Reference.
    

    For example, this shows how you can use regular expressions:

    C:\Documents and Settings\Pax> type qq.cmd
            @setlocal enableextensions enabledelayedexpansion
            @echo off
            set startdir=%cd%
            set temp=%startdir%
            set folder=
        :loop
            if not "x%temp:~-1%"=="x/" (
                set folder=!temp:~-1!!folder!
                set temp=!temp:~1,-1!
                goto :loop
            )
            echo.startdir = %startdir%
            echo.folder   = %folder%
            endlocal
    
    C:\Documents and Settings\Pax> findstr d.r% qq.cmd
            set temp=%startdir%
            echo.startdir = %startdir%
            echo.folder   = %folder%
    
    C:\Documents and Settings\Pax> findstr
    FINDSTR: Bad command line
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i get this error {Method 'System.DateTime ConvertTimeFromUtc(System.DateTime, System.TimeZoneInfo)' has no supported translation to SQL.}
My system has a service (Serv.exe) which starts as LocalSystem and should be running
The bugzilla (perl-based) system has a feature to login automatically by using a http
How do I detect if the system has a default recording device installed? I
According to select name from system_privilege_map System has been granted: SELECT ANY TABLE ...and
I have a large .NET web application. The system has projects for different intentions
We have a system that has a Mysql database with about 2Gigs of data.
I have a web system which has a classical parent-children menu saved in a
The Free MS Windows replacement operating system ReactOS has just released a new version.
I am working with an order system that has two tables Order and OrderLine

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.