For faster navigation, this Iframe is preloading the Wikiwand page for 批次檔.

批次檔

本條目存在以下問題,請協助改善本條目或在討論頁針對議題發表看法。 此條目需要精通或熟悉相关主题的编者参与及协助编辑。 (2014年9月26日)請邀請適合的人士改善本条目。更多的細節與詳情請參见討論頁。 此條目可参照英語維基百科相應條目来扩充。 (2020年8月9日)若您熟悉来源语言和主题,请协助参考外语维基百科扩充条目。请勿直接提交机械翻译,也不要翻译不可靠、低品质内容。依版权协议,译文需在编辑摘要注明来源,或于讨论页顶部标记((Translated page))标签。 此條目需要补充更多来源。 (2022年8月2日)请协助補充多方面可靠来源改善这篇条目无法查证的内容可能會因為异议提出而被移除。致使用者:请搜索一下条目的标题(来源搜索:"批次檔"网页新闻书籍学术图像),以检查网络上是否存在该主题的更多可靠来源(判定指引)。
批次檔(Batch file)
扩展名
.bat .cmd .btm
互联网媒体类型application/x-bat
格式类型腳本語言
作为容器Shell script

批处理文件(英语:Batch file),又称批次档,在DOSOS/2Microsoft Windows中,是一種用來當成腳本語言運作程式的檔案。它本身是文本文件,其中包含了一系列讓具備命令行界面直譯器讀取並執行的指令。它应用于DOSWindows系统中,它是由DOS或者Windows系统内嵌的直譯器(通常是COMMAND.COM或者CMD.EXE)解释运行。它相當於是類Unix系統下的Shell script

DOSWindows 9x作業系統家族中,批次檔的副檔名為.bat。在OS/2Windows NT作業系統家族,添加了.cmd这个副檔名。在其他操作系统中,批处理文件可能具有不同的扩展名,例如,4OS,4OS2和4NT使用.btm副檔名。當執行批次檔時,shell程式會讀取檔案內容,之後通常是以逐行的方式,執行它的命令。其最简单的例子,是逐行书写在命令行中会用到的各种命令。也可以在批次檔後面加上更多種類的參數。更复杂的情况,需要使用if、for、goto、choice等命令控制程式的运行过程,如同C語言Basic等高级语言一样。如果需要实现更复杂的应用,利用外部程式是必要的,这包括系统本身提供的外部命令和第三方提供的工具或者软件。批处理程序虽然是在命令行环境中运行,但不仅仅能使用命令行软件,任何当前系统下可运行的程序都可以放在批处理文件中运行。

有些人认为批处理语言的含义要比上面的描述更广泛,还包括许多软件自带的批处理语言,如 Microsoft OfficeVisual StudioAdobe Photoshop 所内置的批处理语言的功能,用户可通过它们让相应的软件执行自动化操作(例如调整某个资料夹所有 PSD 图档的解析度)。 而这类批处理语言也大多提供把一系列操作录制为批处理文件的功能,这样用户不必写程式就能得到批处理程序。[1]

參考資料

  1. ^ 賴榮樞. 易學易用的 Windows PowerShell. Microsoft TechNet. 2006-06-01 [2014-03-05]. (原始内容存档于2020-02-02). 

參見

{{bottomLinkPreText}} {{bottomLinkText}}
批次檔
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?