At a time when you can't find DOS manuals in bookstores, being able to find a site dedicated to teaching DOS is really exciting!
Moderator,
Could you teach me how to create files, open files, read files, write files, and close files, and how to substitute the contents read from a file into parameters and variables?
In my 98 boot disk I added xcopy.exe smartdrv.exe deltree.exe xcopy32.mod edit.com
Because I have an a.mp3 on D:, and I want to use a .bat method to copy a.mp3 ten thousand times to D:\SP\, with the filenames after COPY increasing from 1 to 10000. So I referred to some beginner books and tried writing it, but with my poor ability I've spent more than a week and nearly 50 hours and still can't make it work, it's always wrong.
So could you please give me some guidance! Thank you!
Below is the wrong edit after I don't know how many tries and how many modifications, until my head became a complete mess. Please correct it for me.
:WIN2000
md d:\win2000
edit d:\win2000\sd.txt
echo "0" >d:\win2000\sd.tx
goto sdd
:sdd
a:
type d:\win2000\sd.txt
"$sd"="%0"
if "$sd" not exist "10000" do xcopy d:\a.txt d:\win2000\
$sd++
ren d:\win2000\a.txt $sd.txt
if "$sd" == "10000" goto END
goto sdd
Moderator,
Could you teach me how to create files, open files, read files, write files, and close files, and how to substitute the contents read from a file into parameters and variables?
In my 98 boot disk I added xcopy.exe smartdrv.exe deltree.exe xcopy32.mod edit.com
Because I have an a.mp3 on D:, and I want to use a .bat method to copy a.mp3 ten thousand times to D:\SP\, with the filenames after COPY increasing from 1 to 10000. So I referred to some beginner books and tried writing it, but with my poor ability I've spent more than a week and nearly 50 hours and still can't make it work, it's always wrong.
So could you please give me some guidance! Thank you!
Below is the wrong edit after I don't know how many tries and how many modifications, until my head became a complete mess. Please correct it for me.
:WIN2000
md d:\win2000
edit d:\win2000\sd.txt
echo "0" >d:\win2000\sd.tx
goto sdd
:sdd
a:
type d:\win2000\sd.txt
"$sd"="%0"
if "$sd" not exist "10000" do xcopy d:\a.txt d:\win2000\
$sd++
ren d:\win2000\a.txt $sd.txt
if "$sd" == "10000" goto END
goto sdd



