批处理文件"为"命令
需要使用Windows计划时间表的命令行操作,能够
Need to be able to "schedule" a command line action using windows scheduler.
这是我的命令:
for /r C:\Users\bob\Downloads\Done\ %f in (*) do @move "%f" C:\Users\bob\Downloads\Done\
它变平的所有文件到主文件夹中。
It flattens all files into the main folder.
在为命令不起作用,作为调度,但工作在CMD.EXE
The "for" command does not work as in a scheduler but is working in cmd.exe
我需要一个批处理文件或其他code,这样我可以使用调度。
I need a batch file or other code so that I can use the scheduler.
我读到这些,但我只是不是很酷:
How复制从文件夹树中删除所有文件夹与文件的Robocopy?
I read these, but I'm just not that cool: How to copy files from folder tree dropping all the folders with Robocopy?
把你上面code,并将其保存在的.bat
文件。你需要做的唯一的变化是一个批处理文件中运行时,百分比(%)需要加倍行动。
Take your above code and save it in a .bat
file. The only change you need to make, is that percents (%) need to be doubled-up when run inside a batch file.
for /r C:\Users\bob\Downloads\Done\ %%f in (*) do (
@move "%%f" C:\Users\bob\Downloads\Done\
)