Windows 10 IoT 核心版命令列 Utils

想要在您的裝置上設定一些設定嗎? 下列工具可供您使用。 在 連線到裝置之後,使用 PowerShell 執行這些命令。

注意

這些工具未預先載入 - 您必須包含適當的功能識別碼,才能在影像中取得這些工具。

IoT 核心專用命令列 Utils

設定啟動應用程式

使用啟動編輯器在 Windows IoT 核心版裝置上設定啟動應用程式。 使用下列任一選項執行 IotStartup

  • IotStartup list 列出已安裝的應用程式
  • IotStartup list headed 列出已安裝的前端應用程式
  • IotStartup list headless 列出已安裝的無周邊應用程式
  • IotStartup list [MyApp] 列出符合模式的已安裝應用程式 MyApp
  • IotStartup add 新增前端和無前端應用程式
  • IotStartup add headed [MyApp] 新增符合模式 MyApp 的前端應用程式。 模式必須只符合一個應用程式。
  • IotStartup add headless [Task1] 新增符合模式的無前端應用程式 Task1
  • IotStartup remove 移除前端和無前端應用程式
  • IotStartup remove headed [MyApp] 移除符合模式的前端應用程式 MyApp
  • IotStartup remove headless [Task1] 移除符合模式的無前端應用程式 Task1
  • IotStartup startup 列出已註冊啟動的前端和無前端應用程式
  • IotStartup startup [MyApp] 列出針對符合模式之啟動註冊的前端和無前端應用程式 MyApp
  • IotStartup startup headed [MyApp] 列出針對符合之啟動註冊的前端應用程式 MyApp
  • IotStartup startup headless [Task1] 列出針對符合之啟動註冊的無前端應用程式 Task1
  • IotStartup run [MyApp] 所識別的啟動應用程式 MyApp
  • IotStartup stop [MyApp] 停止由 識別的應用程式 MyApp
  • 如需進一步的說明,請嘗試 IotStartup help

變更區域和使用者或語音語言的設定

此工具 IoTSettings 會變更區域、使用者語言或語音語言。 這是可從使用 ProcessLauncher API 的應用程式叫用的命令列工具。 這些命令必須以預設帳戶的形式執行,而不是系統管理員。

  • IotSettings del account {all | username} 刪除系統上的所有 MSA 或 Azure AD 帳戶或特定帳戶。 特定帳戶採用表單 username@provider.com
  • IotSettings del diagnostics 會刪除目前裝置在雲端中的診斷資訊。 請注意,這會移除最多叫用時間的歷程記錄。 將會繼續記錄新的診斷資訊。
  • IotSettings list account 列出所有已登入裝置的 MSA 或 Azure AD 帳戶。
  • IotSettings list uilanguage 列出所有 UI 語言
  • IotSettings list speechlanguage 列出所有語音語言
  • IotSettings get uilanguage 顯示目前的 UI 語言
  • IotSettings get speechlanguage 顯示目前的語音語言
  • IotSettings get region 顯示目前區域
  • IotSettings set uilanguage language\_tag - (e.g. fr-CA) 設定預設 UI 語言法文加拿大)
  • IotSettings set speechlanguage language\_tag - (e.g. fr-CA) 設定語音語言法文加拿大)
  • IotSettings set region region\_code - (e.g. CA) 將預設區域設定為加拿大)
  • IotSettings set bluetoothpref {sink | source} 指定當使用 IOT_BLUETOOTH_A2DP_SOURCE 和 IOT_BLUETOOTH_A2DP_SINK 功能建置的裝置連線到另一個同時支援這兩個角色的裝置時,要選取的藍牙角色喜好設定。
  • IotSettings get bluetoothpref 會針對使用 IOT_BLUETOOTH_A2DP_SOURCE 和 IOT_BLUETOOTH_A2DP_SINK 建置的裝置,傳回目前的藍牙角色喜好設定。 預設值為 source。

提示

IoTSettings -list uiLanguage 將會在 Windows IoT 核心映射版本中提供支援的 UI 語言 (清單,該映射已針對該映射執行)

變更預設音訊裝置和音量

此工具 IoTCoreAudioControlTool 可控制音訊相關選項,例如設定預設擷取和播放裝置,以及變更音量。 如需參數的完整清單,請執行 IoTCoreAudioControlTool h

手動安裝 。APPX 檔案

DeployAppx 可讓您在 中安裝及移除 。開發案例中的 APPX 套件。 安裝 的正確方法。生產映射中的 APPX 套件是使用布建套件,如 安裝應用程式 主體中所述。 DeployAppx 也支援查詢 。APPX 套件資訊。

  • DeployAppx install MyApp.appx 會安裝 。如果找到,APPX 和相同名稱的憑證。
  • DeployAppx install force MyApp.appx 強制卸載目前安裝的 。如果在安裝新的 之前找到具有相同套件名稱的 APPX。APPX。 這適用于安裝 。與目前安裝的 相同或更低版本號碼的 APPX。APPX。
  • DeployAppx install retry MyApp.appx 重試安裝 。APPX 10 次失敗,嘗試之間的延遲為 2 秒。
  • DeployAppx uninstall App_1.0.1.0_x86__publisherid123 卸載具有相符套件完整名稱的 .appx。
  • DeployAppx uninstall MyApp.appx 卸載任何已安裝 的 。具有相符套件系列名稱的 APPX。
  • DeployAppx getpackages 列出已安裝的套件完整名稱。
  • DeployAppx getpackageid IotCoreDefaultApp.appx 會列印套件名稱、套件系列名稱,以及 的套件完整名稱。APPX。
DeployAppx getpackageid IotCoreDefaultApp.appx
         Package Name: 16454Windows10IOTCore.IOTCoreDefaultApplication
  Package Family Name: 16454Windows10IOTCore.IOTCoreDefaultApplication_rz84sjny4rf58
    Package Full Name: 16454Windows10IOTCore.IOTCoreDefaultApplication_2.0.8.0_arm__rz84sjny4rf58
  • DeployAppx register appxmanifest.xml 支援

一般命令列 Utils

更新帳戶密碼

強烈建議您更新系統管理員帳戶的預設密碼。 若要這樣做,您可以發出下列命令: net user Administrator [new password] 其中 [new password] 代表您選擇的強式密碼。

建立本機使用者帳戶

如果您想要將 Windows IoT 核心版裝置的存取權授與其他人,您可以在 中 net user [username] [password] /add 輸入 來建立其他本機使用者帳戶。 如果您想要將此使用者新增至其他群組,例如系統管理員群組,請使用 net localgroup Administrators [username] /add

設定密碼

若要變更您裝置上帳戶的密碼,請執行 net user [account-username] [new-password] 以變更帳戶密碼。

查詢和設定裝置名稱

若要識別您目前的裝置名稱,只需輸入 hostname 。 若要變更 Windows IoT 核心版裝置的名稱,請輸入 SetComputerName [new machinename] 。 您可能需要重新開機裝置,名稱變更才會生效。

基本網路設定

許多您可能已經熟悉的基本網路設定公用程式都可在 Windows IoT 核心版中使用,包括 、 netstat.exe 、、 netsh.exeipconfig.exetracert.exearp.exeping.exe 命令。

複製公用程式

Microsoft 提供熟悉的工具,包括 sfpcopy.exexcopy.exe

程序管理

若要檢視目前執行中的進程,您可以嘗試 get-process 或替代方式 tlist.exe 。 若要停止執行中的進程,請輸入 kill.exe [pid or process name]

(無頭開機與前端開機) 設定開機選項

當需要顯示功能時,Windows IoT 核心版裝置可以設定為前端 () 或無周邊 (,當顯示器不需要或) 裝置模式可用時。 若要變更此設定,請使用 setbootoption.exe [headed | headless]

注意

變更此設定需要重新開機,變更才會生效。

工作排程器

若要檢視目前排程的工作清單,請使用 schtasks.exe 命令。 您可以使用 參數建立新的工作 /create ,或使用 參數執行隨選工作 /run 。 如需支援參數的完整清單,請使用 schtasks.exe /?

裝置驅動程式

裝置主控台公用程式有助於識別和管理已安裝的裝置和驅動程式。 如需參數的完整清單,請使用 devcon.exe /?

登錄存取

如果您需要存取登錄以檢視或修改設定,請使用 reg.exe /? Command 取得支援參數的完整清單。

服務

您可以透過 net.exe 命令來完成管理 Windows 服務。 若要查看執行中的服務清單,請輸入 net start 。 若要啟動或停止特定服務,請輸入 net [start | stop] [service name] 。 或者,您也可以透過 sc.exe 命令使用服務控制管理員。

開機設定

您可以使用 來變更 Windows IoT 核心版裝置 bcdedit.exe 的開機設定。 例如,您可以使用 命令來啟用 testigning bcdedit –set testsigning on

關機/重新開機裝置

若要關閉您的裝置,請輸入 shutdown /s /t 0 。 若要重新開機裝置,請改用 /r 參數搭配 命令 shutdown /r /t 0

檢視和變更顯示設定

SetDisplayResolution 工具可用於列出目前的顯示設定,並顯示支援的值清單。 它可進一步用於將顯示器解析度、重新整理速率和/或方向調整為平臺所支援的值。 公用程式接受下列命令列引數:

  • SetDisplayResolution 列出目前的顯示解析度。
  • SetDisplayResolution -list 列出支援的顯示解析度。
  • SetDisplayResolution -orientation:[n] 變更顯示方向,其中 n=0,90,180 或 270。
  • SetDisplayResolution [width] [height] 以圖元變更寬度和高度
  • SetDisplayResolution [width] [height] [refreshrate] 變更寬度、高度和重新整理率,其中寬度和高度以圖元為單位,並以 Hz 重新整理
  • SetDisplayResolution [width] [height] [refreshrate] [orientation] 變更寬度、高度、重新整理率和螢幕方向,其中寬度和高度以圖元為單位、以 Hz 重新整理,方向為 0、90、180 或 270 的其中一個。

擷取

您可以使用 來擷取 Windows IoTCore 裝置 ScreenCapture.exe 的螢幕擷取畫面。 例如,執行 ScreenCapture c:\folder\screencap.jpg 會擷取螢幕擷取畫面,並將它儲存在screencap.jpg檔案中。

取得網路介面卡的相關資訊

若要檢視所有可用的網路介面卡清單,請執行 GetAdapterInfo 工具。

設定 UWP 應用程式的資料夾許可權

並非您裝置上的所有資料夾都可供通用 Windows 應用程式存取。 若要讓 UWP app 能夠存取資料夾,您可以使用 FolderPermissions 工具。 例如,執行 FolderPermissions c:\test -e 以授與 UWP app 資料夾的 c:\test 存取權。 請注意,這只適用于原生 WIN32 API,例如 CreateFile2,而不是使用 WinRT API,例如 StorageFolder、StorageFile 等。

使用序列埠

MinComm 可讓您從命令列使用序列埠。 它會以 ms-iot 範例存放庫中的範例專案的形式提供。

Usage: MinComm.exe [-list] device_path [baud=<B>] [parity=<P>] [data=<D>] [stop=<S>] [xon={on|off}] [odsr={on|off}] [octs={on|off}] [dtr={on|off|hs}] [rts={on|off|hs|tg}] [idsr={on|off}]

  -list                List all available serial ports on the system and exit.
  device_path          Device path or COM port to open (e.g. COM1)
  baud=<B>             Specifies the transmission rate in bits per second.
  parity={n|e|o|m|s}   Specifies how the system uses the parity bit to check
                       for transmission errors. The abbreviations stand for
                       none, even, odd, mark, and space.
  data={5|6|7|8}       Specifies the number of data bits in a character.
  stop={1|1.5|2}       Specifies the number of stop bits that define the end of
                       a character.
  xon={on|off}         Specifies whether the xon or xoff protocol for data-flow
                       control is on or off.
  odsr={on|off}        Specifies whether output handshaking that uses the
                       Data Set Ready (DSR) circuit is on or off.
  octs={on|off}        Specifies whether output handshaking that uses the
                       Clear To Send (CTS) circuit is on or off.
  dtr={on|off|hs}      Specifies whether the Data Terminal Ready (DTR) circuit
                       is on or off or set to handshake.
  rts={on|off|hs|tg}   Specifies whether the Request To Send (RTS) circuit is
                       set to on, off, handshake, or toggle.
  idsr={on|off}        Specifies whether the DSR circuit sensitivity is on
                       or off.

Parameters that are not specified will default to the port's current
configuration. For more information on the connection parameters, see the
Technet documentation for the Mode command:
  https://technet.microsoft.com/library/cc732236.aspx

Examples:
  Connect to the first serial port found in the port's current configuration:
    MinComm.exe

  List all serial ports on the system:
    MinComm.exe -list

  Open COM1 in 115200 8N1 configuration:
    MinComm.exe COM1 baud=115200 parity=n data=8 stop=1

  Open COM1 in 115200 8N1 configuration:
    MinComm.exe \\.\COM1 baud=115200 parity=n data=8 stop=1

  Open device interface in 115200 8N1 configuration:
    MinComm.exe \\?\USB#VID_FFFF&PID_0005#{86e0d1e0-8089-11d0-9ce4-08003e301f73} baud=115200 parity=n data=8 stop=1