Findstr does not work with SET /P?

倾然丶 夕夏残阳落幕 提交于 2019-12-02 07:58:41

Don't use path as one of your own variables, that particular environment variable is used by Windows to locate executable files, such as findstr as you've just discovered.

Change it to something like mypath and your problem should disappear.

To fix this, use a name other than %PATH% to capture the user's input.

%PATH% is a special variable that controls where the command interpreter searches for executables. When you modify %PATH% with your SET /P, you change where the command interpreter will look for FINDSTR. It cannot find FINDSTR.EXE in the new location in %PATH%, hence the error that "'FINDSTR' is not recognized as an internal or external command"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!