使用Powershell脚本将.exe部署到调度程序任务可以通过以下步骤完成:
Start-Process -FilePath "path/to/your/exe.exe" -ArgumentList "arguments" -WindowStyle Hidden
其中,"path/to/your/exe.exe"是你要部署的.exe文件的路径,"arguments"是可选的命令行参数。
$taskAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "path/to/your/deploy.ps1"
$taskTrigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1)
Register-ScheduledTask -TaskName "DeployTask" -Action $taskAction -Trigger $taskTrigger
其中,"path/to/your/deploy.ps1"是你的脚本文件的路径,"DeployTask"是你给任务起的名称。
这样,你就可以使用Powershell脚本将.exe部署到调度程序任务了。
推荐的腾讯云相关产品:腾讯云云服务器(CVM)和腾讯云云函数(SCF)。
云+社区技术沙龙[第11期]
云+社区技术沙龙[第5期]
云+社区技术沙龙[第28期]
云+社区技术沙龙[第8期]
云+社区技术沙龙[第7期]
serverless days
云+社区技术沙龙[第21期]
Techo Day
Elastic 中国开发者大会
领取专属 10元无门槛券
手把手带您无忧上云