Introduction to WIndows Command Line

Cyberkur Syiem 0 Reputation points
2023-05-26T06:07:20.1666667+00:00

findstr [/b] [/e] [/l | /r] [/s] [/i] [/x] [/v] [/n] [/m] [/o] [/p] [/f:flag.txt] [/c:<string>] [/g:flag.txt] [/d:<dirlist>] [/a:<colorattribute>] [/off[line]] <strings> [C:][Users\user4\Documents]flag.txt[ ...]

The system cannot find the file specified.

can you check what's wrong with this commands?

findstr C:\Users\user4\Documents\flag.txt (this one doesn't even show anything)

Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,753 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 40,741 Reputation points
    2023-05-26T06:52:10.3+00:00

    this one doesn't even show anything

    Your post is more then unclear.

    What do you expect, you pass just a file name to the function FINDSTR, but no search pattern or any other parameter; of course you get an empty result.

    0 comments No comments

  2. Limitless Technology 43,931 Reputation points
    2023-06-01T09:28:34.1066667+00:00

    Hi,

    I'd be happy to help you out with your question. Sorry for the inconvenience caused.

    The first command is incorrect because it is missing the /c switch. The /c switch is used to specify the string that you want to find. In this case, you want to find the string flag.txt. So, the correct command would be:

    
    findstr /c:flag.txt C:\Users\user4\Documents
    
    

    The second command is incorrect because it is not specifying a string to find. The findstr command will only print the lines in a file that contain the specified string. So, if you don't specify a string, it will print nothing.

    To fix this, you can add the /c switch and specify the string that you want to find. For example, to find the string flag.txt in the file C:\Users\user4\Documents\flag.txt, you would use the following command:

    
    findstr /c:flag.txt C:\Users\user4\Documents\flag.txt
    
    

    Windows 10 Security is a built-in security app that comes with Windows 10. It provides real-time protection against viruses, malware, and other security threats. You can use Windows 10 Security to scan your computer for threats, manage your security settings, and get help with security problems.

    To open Windows 10 Security, go to Start > Settings > Update & Security > Windows Security.

    You can also open Windows 10 Security by pressing the Windows key + S and searching for "Windows Security."

    Windows 10 Security has a number of features that can help you keep your computer safe. These features include:

    • Real-time protection: Windows 10 Security scans your computer for threats in real time. This means that it will automatically scan any new files that you open or download.
    • Virus and malware protection: Windows 10 Security protects your computer from viruses, malware, and other security threats.
    • Firewall: Windows 10 Security includes a firewall that can help protect your computer from unauthorized access.
    • App and browser control: Windows 10 Security allows you to control which apps and browsers are allowed to run on your computer.
    • Device security: Windows 10 Security helps to protect your computer from threats that come from devices that are connected to your computer, such as USB drives and external hard drives.
    • Account protection: Windows 10 Security helps to protect your computer from threats that come from unauthorized users trying to access your accounts.

    If you are concerned about the security of your computer, you should use Windows 10 Security to help protect it. Windows 10 Security is a powerful tool that can help you keep your computer safe from a variety of threats.

    For more Information, please refer to following resource :-

    findstr | Microsoft Learn - https://learn.microsoft.com/windows-server/administration/windows-commands/findstr

    If you have any other questions or need assistance with anything, please don't hesitate to let me know. I'm here to help.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments