2014-09-23 1 views
0

모든 단일 파일에서 수동으로 명령을 실행하지 않고 VMWare에 사용되는 깨진 vmdk 파일을 모두 한 번에 해결할 수있는 배치 스크립트를 작성하려고했습니다 . 배치 파일로 그다지 큰 일을 해본 적이 없기 때문에 저는 약간의 실수를 저지르고 있습니다! 왜 이것이 작동하지 않는지에 대해 올바른 방향으로 나를 가리킬 수 있습니까?VMWare VMDK 파일을 복구하기위한 배치 파일

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 

입력 해 주셔서 감사합니다.

"%%X"는 각 파일에 대해, 파일 이름으로 대체됩니다 이러한 변화가 당신에게 도움을 줄 경우

+0

시도 할 수 있습니다? – kkuilla

답변

0

을 참조하십시오.
너무 출력 파일 이름을해야합니다 그리고 당신은 왜 작동하지 않습니다 "%%~nX-fixed%%~xX"

cd /d "%VMFolderToFix%" 
for %%X in (*.vmdk) do WMWorkstationDir vmware-vdiskmanager -R "%%X"