我正在尝试理解/学习这些代码引用中的每一个相同之处。有没有人能给我指个好地方看看这个。我假设它的windows powershell代码..但我只是在猜测。
例如- %%a represet
@echo off
rem For each file in your folder
for %%a in (".\*") do (
rem check if the file has an extension and if it is not our script
if "%%~xa" NEQ "" if "%%~dpxa" NEQ "%~dpx0" (
rem check if extension forlder exists, if not it is created
if not exist "%%~xa" mkdir "%%~xa"
rem Copy (or change to move) the file to directory
copy "%%a" "%%~dpa%%~xa\"
)
)发布于 2017-05-30 17:02:19
在这里,%%a提供了每个循环的文件名,%~xa提供了文件扩展名。这就是我现在知道的。任何细节都会很棒。
发布于 2021-01-10 08:12:43
我猜这个程序是根据文件的扩展名对文件进行分组的。然后用建立的扩展名打开目录。然后将文件相应地移动到每个目录..
https://stackoverflow.com/questions/40916247
复制相似问题