The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
16 views

Search strings in text files and show in output the string, preceding one and next one (cmd.exe)

I have a lot of big text files. And I'm searching (within cmd.exe) for a list of values in them as following: findstr /i /n /g:strings.txt 1\*.* >results.txt where strings.txt is the file with ...
1
vote
1answer
181 views

Windows findstr with AND condition?

Is it possible, in one line, without a batch file to use findstr and only return a 0 %errorlevel% if all of the strings are found? I am doing a gem list, which lists out a bunch of gems. I then want ...
0
votes
1answer
91 views

How to remove a line in a file found in multiple directories

There is file that exists in each user profile directory and I need to remove the line from the file in each user profile directory. I'm using a batch script to go through each user profile directory, ...
0
votes
1answer
104 views

Matching Inverse of String in Windows CLI

Can anyone show me a good example of how to match it. Maybe I misread the documentation a bunch of times, but it does not even some close to how real tools like grep ought to work. The output of the ...
1
vote
2answers
8k views

How can I escape double quote character for use in findstr on the PowerShell command line?

This command lines works running in cmd.exe: findstr /l /i /s /c:"key=\"Smtp" *.config However running in PowerShell 2 on Windows 7 Ultimate x64, findstr seems to freeze no matter which combination ...
1
vote
5answers
92 views

Copying a chunk of output in Windows 7

I'm wondering how to copy a chunk of output in the command prompt in Windows 7. What I'm ultimately trying to accomplish is when I type "route print" I want to copy the IPs listed under IPv4 Route ...
2
votes
1answer
3k views

Doing logical OR comparisons with findstr.exe

This may be a stupid question but even after reading the documentation I'm still not sure how to find all lines in a file that contain either ".cpp" or ".h". Is there a way to do that? For example ...