1、自动拨号
:loop
ping -n 3 61.139.2.69 |findstr /c:"Lost" >temp.txt
for /f "tokens=7 delims=, " %%i in (temp.txt) do if %%i equ 3 (goto dail) else (goto loop)
:dail
rasdial kun user password
route add 192.168.0.0 mask 255.255.0.0 192.168.0.1
2、开机自动加载虚拟机
e:\wmvare\vmrun -T ws start "E:\My Documents\My Virtual Machines\Red Hat Enterprise Linux 5 64-bit\Red Hat Enterprise Linux 5 64-bit.vmx"
e:\wmvare\vmrun -T ws start "E:\My Documents\My Virtual MachinesRed Hat Enterprise Linux 5 64-bit_2\Red Hat Enterprise Linux 5 64-bit.vmx"
echo %date%%time% >>e:\wmware_log.txt
echo wmware start now >>e:\wmware_log.txt
echo --------------------------------- >>e:\wmware_log.txt
3、关机自动关闭虚拟机
e:\wmvare\vmrun stop "E:\My Documents\My Virtual Machines\Red Hat Enterprise Linux 5 64-bit\Red Hat Enterprise Linux 5 64-bit.vmx" soft
e:\wmvare\vmrun stop "E:\My Documents\My Virtual MachinesRed Hat Enterprise Linux 5 64-bit_2\Red Hat Enterprise Linux 5 64-bit.vmx" soft
echo %date%%time% >>e:\wmware_log.txt
echo wmware shutdown now >>e:\wmware_log.txt
echo --------------------------------- >>e:\wmware_log.txt
执行“gpedit.msc”,逐级打开“本地计算机策略”-->“计算机配置”-->“Windows设置”-->“脚本”,在窗口右栏中点击“关机”,把需要执行的关机或挂起命令写入一个 .bat 批处理程序中,添加到这里即可
阅读(1429) | 评论(0) | 转发(0) |