Windows设置VMware虚拟机开机后台自启动

第一步是添加环境变量, 将VMware workstation的安装目录加到PATH环境变量里。

我的VMware安装目录

shell

C:\\Program Files (x86)\\VMware\\VMware Workstation
Shell
直接在任务栏搜索框 "环境变量”
notion image
notion image
notion image
notion image
添加之后, 一些确定到底

第二步,找个随便找个文件位置,新建一个xxx.vbs文件, 比如 start.vbs

内容如下:

shell

Dim ws Set ws = Wscript.CreateObject("Wscript.Shell") ws.run "vmrun.exe -T ws start E:\\virtul\\dianxin\\dianxin.vmx nogui",vbhide Wscript.quit
Shell
其中的

shell

E:\\virtul\\dianxin\\dianxin.vmx
Shell
为指定虚拟机的位置. 其中 nogui 的意思是开机后台启动, 如果不想后台启动, 就删掉。
notion image
鼠标悬停就可以看到 编写完成之后, 将该文件创建快捷方式
notion image

shell

win+r
Shell
输入

shell

shell:startup
Shell
打开开机启动目录
notion image
将刚才创建的快捷方式复制到该目录即可实现开机后台启动虚拟机。
notion image
Oracle Cloud利用VNC拯救失联服务器搭建基于Cloudflare Worker的Telegraph的图床D1版
Loading...
hexo