📄 2.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0049)http://www.hongen.com/pc/newer/os/dos/dos0402.htm -->
<HTML><HEAD><TITLE>洪恩在线 - DOS</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="2.files/home.css" rel=stylesheet><LINK href="2.files/tools.css"
rel=stylesheet>
<META content=电脑,乐园,交互,教程,操作系统,DOS,使用,批处理 name=keywords>
<META content="MSHTML 6.00.2800.1561" name=GENERATOR></HEAD>
<BODY text=black bgColor=white leftMargin=0 topMargin=10 marginheight="10"
marginwidth="0"><!--顶部开始-->
<SCRIPT language=Javascript src="2.files/head.js"></SCRIPT>
<!--顶部结束-->
<TABLE height=20 cellSpacing=0 cellPadding=0 width=760 align=center border=0>
<TBODY>
<TR>
<TD class=p1 align=left bgColor=#e8e8e8 height=19><IMG height=8
src="2.files/blank.gif" width=12><FONT color=#ff9966>当前位置</FONT>:<A
class=under href="http://www.hongen.com/default.htm">洪恩在线</A> -> <A
class=under href="http://www.hongen.com/pc/index.htm">电脑乐园</A> ->
DOS</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
<TBODY>
<TR>
<TD height=15></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
<TBODY>
<TR>
<TD class=p1 style="COLOR: blue" vAlign=top align=left width=145
bgColor=#e8e8e8><IMG height=10 src="2.files/blank.gif" width=1
align=center><BR>
<TABLE borderColor=#f8ac0e height=20 cellSpacing=0 cellPadding=0 width=128
align=left border=0>
<TBODY>
<TR vAlign=center bgColor=#000099>
<TD class=p2 align=middle width=115><B><FONT
color=#ffffff>DOS</FONT></B></TD>
<TD width=13 bgColor=#e8e8e8 height=20><IMG height=20
src="2.files/title_00.gif" width=13></TD></TR></TBODY></TABLE>
<P style="LINE-HEIGHT: 17pt" align=left> </P>
<P style="LINE-HEIGHT: 17pt"> 一 <SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0101.htm">DOS概述及入门</A></SPAN><BR> 二
<SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0201.htm">DOS的常用命令</A></SPAN><BR> 三
<SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0301.htm">DOS命令集锦</A></SPAN><BR> 四
<SPAN class=p1>使用批处理文件</SPAN><BR> ※ <SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0401.htm">批处理文件的意义</A></SPAN><BR> ※
<SPAN class=p1>常用命令</SPAN><BR> ※ <SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0403.htm">特殊命令</A></SPAN><BR> ※
<SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0404.htm">autoexec.bat</A></SPAN><BR> 五
<SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0501.htm">如何进行系统配置</A></SPAN><BR> 六
<SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0601.htm">出错提示与对策</A></SPAN><BR> 七
<SPAN class=p1><A
href="http://www.hongen.com/pc/newer/os/dos/dos0701.htm">其它</A></SPAN>
<P style="LINE-HEIGHT: 17pt" align=center><BR><BR>
<P class=p1 align=center><A
href="http://www.hongen.com/pc/bin/msg.pl?file_id=dos_1" target=_blank
traget="_black"><IMG height=54 alt=请您留言 src="2.files/message.gif" width=64
border=0><BR>谈谈您的看法</A> <BR>
<SCRIPT language=javascript>speak_num="za"</SCRIPT>
<SCRIPT language=javascript src=""></SCRIPT>
<SCRIPT language=javascript>var num=0if (!isNaN(speak_num)){ num=speak_num;}else{ num=0}document.writeln ("已有")document.writeln (num)document.writeln ("条发言")</SCRIPT>
</P>
<P style="LINE-HEIGHT: 17pt" align=center><BR> <BR> </P></TD>
<TD width=1 bgColor=#0586d7 height=304><IMG height=1
src="2.files/blank.gif" width=1> </TD>
<TD vAlign=top width=614 background=2.files/line.gif bgColor=#ffffff>
<TABLE width="95%" align=center border=0>
<TBODY>
<TR>
<TD>
<P align=center><BR><B class=p3>使用批处理文件</B></P>
<P> ——常用命令
<DIV class=p2 style="LINE-HEIGHT: 17pt">
<P> echo、@、call、pause、rem 是批处理文件最常用的几个命令,我们就从他们开始学起。
<TABLE cellSpacing=12 width="88%" align=center border=0>
<TBODY>
<TR>
<TD width="18%">echo</TD>
<TD width="82%">表示显示此命令后的字符</TD></TR>
<TR>
<TD width="18%">echo off</TD>
<TD width="82%">表示在此语句后所有运行的命令都不显示命令行本身</TD></TR>
<TR>
<TD vAlign=top width="18%">@</TD>
<TD width="82%">与echo
off相象,但它是加在其它命令行的最前面,表示运行时不显示命令行本身。</TD></TR>
<TR>
<TD vAlign=top width="18%">call</TD>
<TD width="82%">调用另一条批处理文件(如果直接调用别的批处理文件
,执行完那条文件后将无法执行当前文件后续命令)</TD></TR>
<TR>
<TD vAlign=top width="18%">pause</TD>
<TD width="82%">运行此句会暂停,显示Press any key to continue...
等待用户按任意键后继续 </TD></TR>
<TR>
<TD vAlign=top width="18%">rem</TD>
<TD width="82%">表示此命令后的字符为解释行,不执行,只是给自己今后查找用的
</TD></TR></TBODY></TABLE>
<P> 例:用edit编辑a.bat文件,输入下列内容后存盘为c:\a.bat,执行该批处理文件后可实现:将根目录中所有文件写入
a.txt中,启动UCDOS,进入WPS等功能。
<P> 批处理文件的内容为: 文件表示:
<P> echo off 不显示命令行
<P> dir c:\*.* >a.txt 将c盘文件列表写入a.txt
<P> call c:\ucdos\ucdos.bat 调用ucdos
<P> echo 你好 显示"你好"
<P> pause 暂停,等待按键继续
<P> rem 使用wps 注释将使用wps
<P> cd ucdos 进入ucdos目录
<P> wps 使用wps
<P> 批处理文件中还可以像C语言一样使用参数,这只需用到一个参数表示符<FONT color=#0000ff>%</FONT>。
<P> %表示参数,参数是指在运行批处理文件时在文件名后加的字符串。变量可以从
%0到%9,%0表示文件名本身,字符串用%1到%9顺序表示。
<P> 例如,C:根目录下一批处理文件名为f.bat,内容为 format %1
<P> 则如果执行C:\>f a: 则实际执行的是format a:
<P> 又如C:根目录下一批处理文件的名为t.bat,内容为 type %1 type %2
<P> 那么运行C:\>t a.txt b.txt 将顺序地显示a.txt和b.txt文件的内容
<P> </P></DIV></TD></TR></TBODY></TABLE>
<P align=center> </P>
<P class=p1 align=center><A
href="http://www.hongen.com/pc/newer/os/dos/dos0401.htm">上一节</A> <A
href="http://www.hongen.com/pc/newer/os/dos/dos0403.htm">下一节</A></P>
<P class=p2 align=center><A
href="http://www.hongen.com/pc/bin/msg.pl?file_id=dos_1"
target=_blank><IMG height=54 alt=请您留言 src="2.files/message.gif" width=64
border=0><BR>谈谈您的看法</A>
<SCRIPT language=javascript>speak_num="za"</SCRIPT>
<SCRIPT language=javascript src=""></SCRIPT>
<SCRIPT language=javascript>var num=0if (!isNaN(speak_num)){ num=speak_num;}else{ num=0}document.writeln ("已有")document.writeln (num)document.writeln ("条发言")</SCRIPT>
</P>
<P> </P></TD></TR></TBODY></TABLE><!--底部开始-->
<SCRIPT language=Javascript src="2.files/foot.js"></SCRIPT>
<!--底部结束--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -