Is there a Windows equivalent of the Unix "strings" command?

75,645

Solution 1

Not (AFAIK) built in, but there is one available from SysInternals (live link). The SysInternals strings isn't a straight port of the Unix tool; it was written to find Unicode strings as well as ASCII:

Working on NT and Win2K means that executables and object files will many times have embedded UNICODE strings that you cannot easily see with a standard ASCII strings or grep programs.

Solution 2

I believe MinGW contains a Windows version of GNU binutils, which in turn contains the strings program. You could try that.

Solution 3

A quick simple solution:

more < FILE_PATH.exe | findstr "."

This will print all strings from any kind of file ( with a little extra junk ), separated by a new line.

What actually happens is more < FILE_PATH.exe prints an ascii view of FILE_PATH.exe into the console, and the findstr "." filters out anything that isn't a string ( define a minimum length by adding more '.' e.g. findstr "....." will filter for only strings of length 5+ ).

strings -n 4 FILE_PATH => more < FILE_PATH | findstr "...."

strings -n 8 FILE_PATH => more < FILE_PATH | findstr "........"

And of course you can use findstr to make a more exact filter ( see findstr /? )

Solution 4

The Sysinternals tool Strings is a Windows console program which can extract ASCII And Unicode strings from binary files.

Share:
75,645

Related videos on Youtube

Ng Zhong Qin
Author by

Ng Zhong Qin

Updated on September 17, 2022

Comments

  • Ng Zhong Qin
    Ng Zhong Qin over 1 year

    strings in Unix and Linux extracts printable strings from a binary file. Is there a version of this for Windows? I couldn't find one.

  • quack quixote
    quack quixote about 14 years
    and of course binutils is included in the Cygwin environment (cygwin.com). it doesn't seem to be included in GnuWin32 and UnxUtils, two other ports projects that provide unix utilities on Windows.
  • Synetech
    Synetech over 10 years
    @slm, in this case, the link is the content. If the link breaks, then no amount of content will be of use since the file can no longer be downloaded. In fact, the original post was actually better than it is now because at least then, it displayed the raw URL which showed that the program in question was from Microsoft and included the keyword sysinternals. Therefore, if the link died, someone could still try to search for the file by using those as a guide. Now, the link is merged into the text so there is nothing indicating what the file is. No worries, I’ll fix it now.
  • slm
    slm over 10 years
    @Synetech - OK.
  • user66001
    user66001 about 7 years
    -1 No need to have 2 answers with the same info.
  • SABA
    SABA almost 4 years
    how can I use this in Windows 10, please?