Powershell command-line with Autologon.exe

眉间皱痕 提交于 2019-12-08 15:08:31

I generally use Start-Process with the ArgumentList parameter to run programs with arguments:

$autologon = "C:\folder\Autologon.exe"
$username = "guest10"
$domain = "domain"
$password = "Password1"

Start-Process $autologon -ArgumentList $username,$domain,$password

Or you can put them directly into the command:

Start-Process "C:\folder\Autologon.exe" -ArgumentList "guest10","domain","Password1"
Bjorn Hamsterdam

This worked for me:

Start-Process -FilePath $exePath -ArgumentList "/accepteula", $user, $domain, $password -Wait

It's very picky about quote placement.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!