*.bat 和 *.cmd 文件有什么区别?
您好,
我正在学习 Windows批量编程时遇到这个问题:
.bat和.cmd文件有什么区别?
如果它们是相同的,为什么需要两个?
顺便说一句,command.com 和 cmd.exe 之间有什么区别?
Possible Duplicate:
Windows batch files: .bat vs .cmd?
Hi,
I am learning Windows Batch programming and come across this question:
What's the difference between .bat and .cmd file?
If they are the same, why need 2 of them?
BTW, what's the difference between command.com and cmd.exe ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
.bat
文件是 DOS 遗留下来的文件。.cmd
文件适用于 Window NT 命令处理器或更高版本,并且具有更多功能(一些循环结构、从过程类型块调用和返回的能力)。command.com
是操作系统的运行所在,并包含 DOS 和早期版本的 Windows 中的dir
等内部命令。 Windows NT 推出后,它被cmd.exe
取代,成为第一个 32 位命令处理器。.bat
files are left-overs from DOS..cmd
files are for Window NT command processor or higher, and have more capabilities (some looping structures, the ability to call and return from procedural type blocks).command.com
was what ran the operating system and contained the internal commands likedir
in DOS and early versions of Windows. It was replaced bycmd.exe
when Windows NT was introduced, and was the first 32-bit command processor.这可能对你有帮助
Windows 批处理文件:.bat 与 .cmd?
http://www.pcreview.co.uk/forums/ cmd-vs-bat-t1468592.html
在 Google 群组中发现的已记录的差异
就 CMD.EXE 而言,.CMD 和 .BAT 之间的区别是:
启用扩展后,.CMD 中的 PATH/APPEND/PROMPT/SET/ASSOC
无论错误如何,文件都会设置 ERRORLEVEL。 .BAT 设置错误级别
仅针对错误。
This might help you
Windows batch files: .bat vs .cmd?
http://www.pcreview.co.uk/forums/cmd-vs-bat-t1468592.html
A documented difference found in google groups
The differences between .CMD and .BAT as far as CMD.EXE is concerned are:
With extensions enabled, PATH/APPEND/PROMPT/SET/ASSOC in .CMD
files will set ERRORLEVEL regardless of error. .BAT sets ERRORLEVEL
only on errors.