The problem is that VMware Workstation Autostart service doesn't work.
Start-Process powershell -Verb RunAs "Set-Service -Name VmwareAutostartService -StartupType Manual"
Start-Process powershell -Verb RunAs "&icacls.exe '$env:ProgramData\VMware\VMware Workstation\vmautostart.xml' /grant '${env:USERDOMAIN}\${env:USERNAME}:F'"
- Cmd-R
shell:startup
- Create a folder called
.scripts
and drop the fileautostart-vmware.ps1
in it - Create a shortcut in the startup folder by running the following:
$Ws = New-Object -COMObject WScript.Shell
$Startup = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup"
$S = $Ws.CreateShortcut("$Startup\autostart-vmware.lnk")
$S.TargetPath = "$env:windir\System32\WindowsPowerShell\v1.0\powershell.exe"
$S.Arguments = "-ExecutionPolicy Bypass -File `"$Startup\.scripts\autostart-vmware.ps1`""
$S.WindowStyle = 7 # 1: normal, 3: maximized, 7: minimized
$S.Save()
Note: Run the above in any regular Powershell terminal as your user (not Administrator)