China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-23 22:08
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » How can I make a DOS command like this? View 633 Replies 2
Original Poster Posted 2003-12-18 00:00 ·  中国 广东 河源 电信
高级用户
★★
Credits 916
Posts 201
Joined 2003-05-04 00:00
23-year member
UID 1849
Gender Male
Status Offline
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?
Floor 2 Posted 2003-12-18 00:00 ·  中国 广东 肇庆 电信
高级用户
★★
Credits 578
Posts 135
Joined 2003-07-10 00:00
23-year member
UID 6709
Gender Male
Status Offline
I don't understand what you mean!
Floor 3 Posted 2003-12-19 00:00 ·  中国 广东 佛山 禅城区 电信
初级用户
爱之屋论坛管理员
Credits 158
Posts 14
Joined 2003-12-17 00:00
22-year member
UID 14122
Gender Male
Status Offline
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.







Forum Jump: