我想编写一个函数,用另一个嵌入式命令%another%在另一个目录(共享驱动器)中执行“find”命令。如何使用另一个目录中的另一个嵌入式命令执行“查找”命令?
下面的理念是:
REM Take in log file name input eg. "result_10030" = %1 to search for all result_10030*.log = %1*.log
REM Use the following to list the files matching result_10030*.log
for /f "delims=" %%x in ('dir /d /od /b %1*.log') do set recent=%%x
echo %recent%
REM Use %recent% as the file to perform find
REM Take in %2 as share drive path
find "PASSED" %2%recent%
显然,这是行不通的。
您的建议将不胜感激! :)
这看起来像一个Windows批处理文件 - 与DOS,C#,python.net或窗口(GUI事物,而不是OS)无关。或者我错过了什么? – dbenham