:重启电脑命令
@echo off
echo 重启电脑?:start
echo 输入y重启,输入其它取消重启
set /p a=请输入字母:
if "%a%"=="y" goto sd
if not "%a%"=="y" goto cc
echo 无goto
:cc
echo cc 取消操作!
shutdown -a
goto start
exit
:sd
shutdown -r -t 10
rem logoff
goto start
exit
:关闭和启动虚拟机和数据库服务,win7要以管理员身份运行bat
@echo off
echo 打开数据库服务:opensql,关闭:closesql?
echo 打开虚拟机服务:openvm,关闭:closevm?
:start
set /p a=请输入字母:
if "%a%"=="opensql" goto opensql
if "%a%"=="openvm" goto openvm
if "%a%"=="closevm" goto closevm
rem if not "%a%"=="y" goto no
if "%a%"=="closesql" goto closesql
echo 无操作!
goto start
:closesql
echo 取消操作!
net stop MSSQL$SQL2008
goto start
exit
:opensql
net start MSSQL$SQL2008
goto start
exit
:openvm
:启动,打印命令
net start vmnetdhcp
net start "VMware NAT Service"
:启用网络连接
netsh interface set interface name="VMware Network Adapter VMnet1" admin=ENABLED
netsh interface set interface name="VMware Network Adapter VMnet8" admin=ENABLED
goto start
:closevm
:停止服务
net stop vmnetdhcp
net stop "VMware NAT Service"
:禁用网络连接
netsh interface set interface name="VMware Network Adapter VMnet1" admin=DISABLED
netsh interface set interface name="VMware Network Adapter VMnet8" admin=DISABLED
:强杀进程
taskkill /F /im vmware-tray.exe
goto start