华域联盟 DOS/BAT 批处理BAT加强函数代码使用说明第1/3页

批处理BAT加强函数代码使用说明第1/3页

文章结构

1. 所有内置命令的帮助信息

2. 环境变量的概念

3. 内置的特殊符号(实际使用中间注意避开)

4. 简单批处理文件概念

5. 附件1 tmp.txt

6. 附件2 sample.bat

######################################################################

1. 所有内置命令的帮助信息

######################################################################

ver

cmd /?

set /?

rem /?

if /?

echo /?

goto /?

for /?

shift /?

call /?

其他需要的常用命令

type /?

find /?

findstr /?

copy /?

______________________________________________________________________

下面将所有上面的帮助输出到一个文件

echo ver >tmp.txt

ver >>tmp.txt

echo cmd /? >>tmp.txt

cmd /? >>tmp.txt

echo rem /? >>tmp.txt

rem /? >>tmp.txt

echo if /? >>tmp.txt

if /? >>tmp.txt

echo goto /? >>tmp.txt

goto /? >>tmp.txt

echo for /? >>tmp.txt

for /? >>tmp.txt

echo shift /? >>tmp.txt

shift /? >>tmp.txt

echo call /? >>tmp.txt

call /? >>tmp.txt

echo type /? >>tmp.txt

type /? >>tmp.txt

echo find /? >>tmp.txt

find /? >>tmp.txt

echo findstr /? >>tmp.txt

findstr /? >>tmp.txt

echo copy /? >>tmp.txt

copy /? >>tmp.txt

type tmp.txt

______________________________________________________

######################################################################

2. 环境变量的概念

######################################################################

_____________________________________________________________________________

C:\Program Files>set

ALLUSERSPROFILE=C:\document. and Settings\All Users

CommonProgramFiles=C:\Program Files\Common Files

COMPUTERNAME=FIRST

ComSpec=C:\WINNT\system32\cmd.exe

NUMBER_OF_PROCESSORS=1

OS=Windows_NT

Os2LibPath=C:\WINNT\system32\os2\dll;

Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\WBEM

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

PROCESSOR_ARCHITECTURE=x86

PROCESSOR_IDENTIFIER=x86 Family 6 Model 6 Stepping 5, GenuineIntel

PROCESSOR_LEVEL=6

PROCESSOR_REVISION=0605

ProgramFiles=C:\Program Files

PROMPT=$P$G

SystemDrive=C:

SystemRoot=C:\WINNT

TEMP=C:\WINNT\TEMP

TMP=C:\WINNT\TEMP

USERPROFILE=C:\document. and Settings\Default User

windir=C:\WINNT

_____________________________________________________________________________


1
2
3
下一页
阅读全文

本文由 华域联盟 原创撰写:华域联盟 » 批处理BAT加强函数代码使用说明第1/3页

转载请保留出处和原文链接:https://www.cnhackhy.com/16037.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部