A Simple Batch Processing Dilemma
@ECHO OFF
for %%i in (c d e f g h i j ) do if exist %%i:\SYS.gho GOTO label
goto err
:label
label %%i:SYSTEM
md %%i:\boot
copy aa.txt %%i:\boot
goto exit
:err
echo nofile
:exit
The meaning of the batch processing is: If the C partition has the SYS.GHO file, jump to :label to execute the corresponding commands and no longer continue to search other partitions, and so on...
But when executed according to the above writing, an error occurs. Many netizens have given different solutions, but none are correct.
Please ask experts like willsort to come to the rescue!
@ECHO OFF
for %%i in (c d e f g h i j ) do if exist %%i:\SYS.gho GOTO label
goto err
:label
label %%i:SYSTEM
md %%i:\boot
copy aa.txt %%i:\boot
goto exit
:err
echo nofile
:exit
The meaning of the batch processing is: If the C partition has the SYS.GHO file, jump to :label to execute the corresponding commands and no longer continue to search other partitions, and so on...
But when executed according to the above writing, an error occurs. Many netizens have given different solutions, but none are correct.
Please ask experts like willsort to come to the rescue!


