中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-27 01:04
47,815 topics / 349,928 posts / today 0 new / 48,289 members
DOS启动盘 & LOGO技术 (启动盘室) » How can I make a DOS command like this?
Printable Version  797 / 2
Floor1 walu Posted 2003-12-18 00:00
高级用户 Posts 201 Credits 916
After booting with a WIN 98 boot disk, under DOS, I want to turn these two commands, “sys e:” and “copy abc.exe e:”, into a single command, so that running it once is equivalent to finishing the above two steps. Of course this can be done with a batch file, but the hard part is that the E drive in the two commands above is not fixed; it could be sys e:, or it could be sys f: or sys g:
I’ve seen some experts make a *.com file so that *.com X (x is any drive letter) can do it
How should this be made?
Floor2 hzy Posted 2003-12-18 00:00
高级用户 Posts 135 Credits 578
I don't understand what you mean!
Floor3 drlzf Posted 2003-12-19 00:00
初级用户 Posts 14 Credits 158
Try this:
Create a my.bat file, and put this in it:

@echo off
if "%1"="" goto end
if "%2"="" goto end
:start
set drv=%1
set copyfile=%2
sys %drv%:
copy %copyfile% %drv%:
:end
if not "%drv%"="" set drv=
if not "%copyfile%"="" set copyfile=

After that, run it like this:
my.bat e: abc.exe
Here, “e:” is your drive letter, and “abc.exe” is the filename you want to copy.







[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023