0

我一直在尝试编写一个批处理脚本,它允许我vmdk一次性修复用于 VMWare 的损坏文件,而不必在每个文件上手动运行命令。从来没有真正使用过批处理文件,我有点挣扎!谁能指出我为什么这不起作用的正确方向?

set /p WMWorkstationDir = Enter the directory of the VmWare Workstation install, and press enter;
set /p VMFolderToFix = Enter the directory where the VMDK files live that you wish to repair, and press enter;
Rem this is to set up working names in the batch file for the directories specified, helping abstract it
cd VMFolderToFix
for %%X in (*.vmdk) do WMWorkstationDir vmware-vdiskmanager -R
Rem trying to get the repair command to run on all the vmdk files in the target location

感谢您的任何意见!

4

1 回答 1

0

看看这些更改是否对您有所帮助:

"%%X"被每个文件的文件名替换。
您可能还需要一个输出文件名,您可以尝试"%%~nX-fixed%%~xX"

cd /d "%VMFolderToFix%"
for %%X in (*.vmdk) do WMWorkstationDir vmware-vdiskmanager -R "%%X"
于 2014-09-23T12:57:01.343 回答