【发布时间】:2016-01-13 04:36:44
【问题描述】:
findstr 有一个我在 Windows 7 上不理解的简单行为。
我在多个不同位置使用以下脚本以管理员模式运行批处理文件(如果不是,它们根本不会启动):
@echo off
set local=%~dp0
echo %local%
REM to check that I am where I think I am
findstr /s /i /c:"stringtofind" %local%*.ext
当我从"C:\Program files\~" 或"C:\Program files (x86)\~" 中的位置运行此脚本时,输出包括%local% 目录和带有"stringtofind" 的子目录之外的.ext 文件。实际上所有匹配的文件都在硬盘上。
这种行为不会出现在我可以测试的所有其他位置(基本上在 C:\ 目录中的任何其他位置),其中仅出现目录和子目录中的匹配文件。
Program files 目录有什么特定的吗?
【问题讨论】:
标签: windows batch-file windows-7 findstr