官方網址:
https://learn.microsoft.com/zh-tw/windows-hardware/drivers/devtest/pnputil
PnPUtil是 Windows下用於管理驅動及設備的命令列工具
/enum-devices
列舉系統中 class name為 USB的裝置
官方網址:
https://learn.microsoft.com/zh-tw/windows-hardware/drivers/devtest/pnputil
PnPUtil是 Windows下用於管理驅動及設備的命令列工具
列舉系統中 class name為 USB的裝置
官方網址:
https://learn.microsoft.com/en-us/windows/core-utils/overview
https://github.com/microsoft/coreutils
Coreutils可以在原生Windows上跑 UNIX風格命令列工具,由 Microsoft自己維護。
安裝:
能用的命令可以參考:
https://learn.microsoft.com/en-us/windows/core-utils/commands
在公司的工作機是使用 Windows筆電,有時候會需要連到遠端 Linux機器,記錄一些會使用
到的指令。
根據微軟官網,Windows 本身已經內建 SSH client應用程式。
透過 ssh連線到遠端的主機,之後會跳出提示輸入密碼。
退出 ssh連線回到 Windows Terminal。
SCP是使用 SSH的遠端加密傳輸檔案指令。
將本地的 C:\a.txt傳送到遠端 machine的 user目錄中。
將本地的 C:\a.txt傳送到遠端 machine的 user目錄中,並命名成 b.txt。
將遠端 machine的 user目錄中 b.txt傳送到本地端的 C:\目錄中。
將遠端 machine的 user目錄中 b.txt傳送到本地端的 C:\目錄中,並命名成 c.txt。
將遠端 machine的 user目錄中 test目錄遞迴複製傳送到本地端的 C:\ (C:\test)。
將本地端的 C:\test目錄遞迴複製到遠端的 user目錄中 (~/test)。
Windows Server 評估版在過了使用期限後,還是可以透過 slmgr來延長。
透過 Win + R快捷鍵執行:
查看使用期限及剩餘可延長次數
slmgr.vbs /dlv延長使用授權
slmgr.vbs /rearm| Categories | Package | Description |
| Devel | gcc-core | GNU Compiler Collection (C, OpenMP) |
| Devel | gcc-g++ | GNU Compiler Collection (C++) |
| Devel | make | The GNU version of the 'make' utility |
| Devel | binutils | GNU assembler, linker and similar utility |
| Devel | gdb | The GNU debugger |

在剛開始寫Batch的迴圈(for)的時候,都會遇到一個問題,就是在迴圈中,想要去改變(set)
某個變數的值,可是卻沒有作用。
Example:
上面範例原意是想讓 var在每次的迴圈中都 +1,最後的值會是 5。可是在迴圈中每次 echo出的值都是一開始的 var值 0。
原因是 var在 batch file被解析的時候就會提前展開,所以在迴圈中會 echo出一開始被展開的值。要得到預想的結果就要使用
setlocal EnableDelayedExpansion來延遲變數展開,使其在執行的階段才會被展開。
Example:
| Key   | Description   |
| delims=xxx   | 設定分隔字元(預設為空白字元),xxx表示可設定多個字元。   |
| token=x,y   token=z*   token=m-n   |
用來決定要取出的item,並且放到parameter中。  若token=x,就取出第x項item。   token=x,y,若parameter設為%a,便取出第x與y項item分別置於%a和%b自動變數中。  token=z*,若parameter設為%a,取出第z項置於%a中,並將第z項後的所有item置於%b中。  若token=m-n,便取出第m至第n項。  |