如何从命令提示符下打开目录中的所有文件

时间:2018-08-28 16:02:13

标签: windows command

我不会使用Windows命令提示符打开某个文件夹中的每个excel文件。我知道如果知道每个文件的名称,便可以执行此操作,但是由于文件名可能会更改,我只想打开所有文件。谢谢。

1 个答案:

答案 0 :(得分:0)

# find /opt/ -name 'hadoop-yarn-server-timelineservice*jar'
/opt/hadoop-3.1.1/share/hadoop/yarn/timelineservice/hadoop-yarn-server-timelineservice-3.1.1.jar
/opt/hadoop-3.1.1/share/hadoop/yarn/timelineservice/hadoop-yarn-server-timelineservice-hbase-common-3.1.1.jar
/opt/hadoop-3.1.1/share/hadoop/yarn/timelineservice/test/hadoop-yarn-server-timelineservice-hbase-tests-3.1.1.jar
/opt/hadoop-3.1.1/share/hadoop/yarn/timelineservice/hadoop-yarn-server-timelineservice-hbase-coprocessor-3.1.1.jar
/opt/hadoop-3.1.1/share/hadoop/yarn/timelineservice/hadoop-yarn-server-timelineservice-hbase-client-3.1.1.jar

在命令提示符下,您可以执行上述命令,以打开当前目录中的所有excel工作表。您也可以通过提供完整路径将其存储为批处理文件

for %1 in (*.xlsx) do start excel "%%1"

编辑:如@CristiFati所述,如果路径中没有excel,则

for %1 in (<path>\*.xlsx) do start excel "%%1"