命令行 (firstlogoncommands-synchronouscommand-命令行) CommandLine (microsoft-windows-shell-setup-firstlogoncommands-synchronouscommand-commandline)

CommandLine 指定要在首次登录时运行的 SynchronousCommand 的路径。CommandLine specifies the path to the SynchronousCommand to be run at first logon.

如果创建不包含管理权限的用户帐户,则可能无法执行以下命令:If you create a user account that does not include administrative privileges, the following commands may not be executed:

  • 如果启用了 "用户帐户控制",则当该用户第一次登录时,将出现一个对话框,提示用户提供允许管理员应用命令的选项。If User Account Control is enabled, then when that user logs in for the first time, a dialog box appears, prompting the user with an option to allow an administrator to apply the commands. 如果用户选择 " 取消",则不会执行这些命令。If the user selects Cancel, these commands are not executed.

  • 如果禁用了 "用户帐户控制",则不会执行这些命令。If User Account Control is disabled, these commands are not executed.

使用 FirstLogonCommands 添加脚本时,它将在下一次启动时触发,即使使用 Ctrl + Shift + F3 进入审核模式也是如此。When you add a script using FirstLogonCommands, it will be triggered on the next boot, even if you boot into audit mode using Ctrl+Shift+F3. 如果你计划稍后使用审核模式,请添加以下设置以自动跳过此脚本: Microsoft Windows-部署重新 \ 封装 \ 模式= audit。If you plan to use audit mode later, add the following setting to skip this script automatically: Microsoft-Windows-Deployment\Reseal\Mode = Audit.

Values

Path_to_commandPath_to_command

指定要在首次登录时运行的命令的路径。Specifies the path to the command to be run at first logon. Path_to_command 是最大长度为1024个字符的字符串。Path_to_command is a string with a maximum length of 1024 characters.

该字符串类型支持空元素。This string type supports empty elements.

有效的配置阶段Valid Configuration Passes

oobeSystemoobeSystem

父层次结构Parent Hierarchy

Microsoft-Shell-安装程序 | FirstLogonCommands | SynchronousCommand | 命令行Microsoft-Windows-Shell-Setup | FirstLogonCommands | SynchronousCommand | CommandLine

适用于Applies To

有关此组件支持的 Windows 版本和体系结构的列表,请参阅 Microsoft-Windows Shell 设置For a list of the supported Windows editions and architectures that this component supports, see Microsoft-Windows-Shell-Setup.

XML 示例XML Example

以下 XML 输出显示了如何设置第一个登录命令。The following XML output shows how to set first logon commands.

<FirstLogonCommands>
   <SynchronousCommand wcm:action="add">
      <CommandLine>c:\synccommands\command1.exe</CommandLine>
      <Description>Description_of_command1</Description>
      <Order>1</Order>
   </SynchronousCommand>
   <SynchronousCommand wcm:action="add">
      <CommandLine>c:\synccommands\command2.exe</CommandLine>
      <Description>Description_of_command2</Description>
      <Order>2</Order>
   </SynchronousCommand>
</FirstLogonCommands>

SynchronousCommandSynchronousCommand