Recently I wrote a batch program, but every time it reaches this part, something is wrong:
*******************************
echo Which partition do you want to restore the system to (please enter the partition number or drive letter)?: (123456789 or DEFGHIJKL)
set WHAT=
what s
for %%a in (D E F G H I J K L) do IF == goto _copy
for %%b in (1 2 3 4 5 6 7 8 9) do IF == set HDRV=1:%%b
ghost -clone,mode=pload,src=%CDROM%\sysbak.GHO:1,dst=%HDRV% -sure -rb
goto to_BOOT
:_copy
for %%c in (C D E F G H I J K L) do IF == set HDRV=%WHAT%
sys %HDRV%:
copy /y a:\gho\*.*\ %HDRV%
************************************
Later, I found that the value in the variable %HDRV% is incorrect, it's empty. It seems these two sentences are wrong:
for %%a in (D E F G H I J K L) do IF == goto _copy
for %%b in (1 2 3 4 5 6 7 8 9) do IF == set HDRV=1:%%b
Please brothers help me see where the problem is? Why?
—————————————— Edited by willsort ——————————————
Original title: Please brothers help me see where this batch is wrong.
To facilitate users' browsing and moderators' management, please briefly describe its content or intention in the post title
You can click the "Edit" button below the post to modify the title on the editing page and confirm it
If no modification is made within three days, the moderator will modify it, and the author of this post will be deducted 4 points of points at the same time
—————————————— Edited by willsort ——————————————
[ Last edited by sglxy on 2005-11-1 at 23:51 ]
*******************************
echo Which partition do you want to restore the system to (please enter the partition number or drive letter)?: (123456789 or DEFGHIJKL)
set WHAT=
what s
for %%a in (D E F G H I J K L) do IF == goto _copy
for %%b in (1 2 3 4 5 6 7 8 9) do IF == set HDRV=1:%%b
ghost -clone,mode=pload,src=%CDROM%\sysbak.GHO:1,dst=%HDRV% -sure -rb
goto to_BOOT
:_copy
for %%c in (C D E F G H I J K L) do IF == set HDRV=%WHAT%
sys %HDRV%:
copy /y a:\gho\*.*\ %HDRV%
************************************
Later, I found that the value in the variable %HDRV% is incorrect, it's empty. It seems these two sentences are wrong:
for %%a in (D E F G H I J K L) do IF == goto _copy
for %%b in (1 2 3 4 5 6 7 8 9) do IF == set HDRV=1:%%b
Please brothers help me see where the problem is? Why?
—————————————— Edited by willsort ——————————————
Original title: Please brothers help me see where this batch is wrong.
To facilitate users' browsing and moderators' management, please briefly describe its content or intention in the post title
You can click the "Edit" button below the post to modify the title on the editing page and confirm it
If no modification is made within three days, the moderator will modify it, and the author of this post will be deducted 4 points of points at the same time
—————————————— Edited by willsort ——————————————
[ Last edited by sglxy on 2005-11-1 at 23:51 ]
