jda*_*mae 8 windows command-line batch-file
我收到一条错误消息,指出无法将文件移动到单个文件。我不是要这样做。我想要做的是将文件从一个文件夹移动到另一个文件夹(暂存),然后删除原始文件夹。
如果你能告诉我一个更好的方法来做到这一点,因为我没有正确地做到这一点。
这是我的.cmd文件:
Y:
move "Y:\ABC_files\*.js" "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
move "Y:\ABC_files\*.CSS" "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
move "Y:\ABC_files\*.png" "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
move "Y:\ABC_files\*.htm" "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
move "Y:\ABC_files\*.gif" "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
move "Y:\ABC.htm "C:\Documents and Settings\user\Desktop\ABC_Stage\"
rmdir "Y:\ABC_files"
C:\"Program Files"\"App X"\App-IDE.exe -r ABC4.run
Run Code Online (Sandbox Code Playgroud)
就个人而言,我更喜欢这里的 XCOPY,因为它有更多可能有用的选项,特别是如果您更改批处理文件,然后使用开关删除旧目录和文件。
除非文件位置或名称中有实际空格,否则我也会转储引号。在您的最后一步中,您实际上放弃了引用,这可能会产生错误。您的最后一条语句也是不正确的:您只在开关前的 WHOLE 命令周围加上引号,而不是其中的一部分。我添加了我认为可能有用的开关:您可以通过执行 xcopy /? 在命令提示符下。我还会质疑您在上一份副本中是否 abc.htm 真的在根目录中...检查一下,并在必要时进行相应的编辑。最后,确保您编辑用户部分以反映您的用户名。我对您的最后一行一无所知,因为那是特定于应用程序的。
Y:
xcopy Y:\ABC_files\*.js "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
xcopy Y:\ABC_files\*.css "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
xcopy Y:\ABC_files\*.png "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
xcopy Y:\ABC_files\*.htm "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
xcopy Y:\ABC_files\*.gif "C:\Documents and Settings\user\Desktop\ABC_Stage\ABC_files\"
xcopy Y:\ABC.htm "C:\Documents and Settings\user\Desktop\ABC_Stage\"
rd Y:\ABC_files /s /q
del Y:\ABC.htm
"C:\Program Files\App X\App-IDE.exe" -r ABC4.run
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
99378 次 |
| 最近记录: |