跳轉到內容

Windows 批處理指令碼/環境命令

來自華夏公益教科書,開放的書籍,開放的世界

4. 環境命令

[編輯 | 編輯原始碼]

本章涵蓋以下命令

  • Netstat -n = 顯示網路中的所有計算機
  • Shutdown -i = 開啟遠端關機日誌,您可以在其中關機網路中的任何計算機。
  • ASSOC - 顯示或修改副檔名關聯。
  • AT - 安排命令和程式在計算機上執行。
  • DATE - 顯示或設定日期。
  • FTYPE - 顯示或修改副檔名關聯中使用的檔案型別。
  • LABEL - 建立、更改或刪除磁碟的卷標。
  • PATH - 顯示或設定可執行檔案的搜尋路徑。
  • SET - 顯示、設定或刪除 Windows 環境變數。
  • SUBST - 將路徑與驅動器號關聯。
  • TIME - 顯示或設定系統時間。
  • VER - 顯示 Windows 版本。
  • VOL - 顯示磁碟卷標和序列號。

DATE 命令

[編輯 | 編輯原始碼]

此命令顯示或設定當前日期。

C:\WB>DATE
The current date is: 06/12/2008
Enter the new date: (dd-mm-yy) 01-01-2009

C:\WB>DATE
The current date is: 01/01/2009
Enter the new date: (dd-mm-yy)

C:\WB>DATE /T
01/01/2009

C:\WB>DATE
The current date is: 01/01/2009
Enter the new date: (dd-mm-yy) 06-12-2008

C:\WB>DATE /T
06/12/2008

C:\WB>

有沒有辦法更改日期格式?

SUBST 命令

[編輯 | 編輯原始碼]

有時將路徑與驅動器號關聯很有用。

C:\>SUBST H: bea\user_projects\domains

C:\>
華夏公益教科書