赞
踩
bat创建桌面快捷方式,并用浏览器打开网页,项目部署时使用
@echo off
echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs
echo sLinkFile = "%userprofile%\Desktop\lckj.lnk" >> CreateShortcut.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs
echo oLink.TargetPath = "C:\Users\Administrator\appData\local\Google\chrome\application\chrome.exe" >> CreateShortcut.vbs
echo oLink.Arguments = "http://localhost:81" >> CreateShortcut.vbs
var pathe = "D:\pool\ChromeCore";
echo oLink.WorkingDirectory = pathe >> CreateShortcut.vbs
echo oLink.Description = "管理系统快捷方式" >> CreateShortcut.vbs
echo oLink.IconLocation = "D:\lckj\favicon.ico" >> CreateShortcut.vbs
echo oLink.Save >> CreateShortcut.vbs
cscript CreateShortcut.vbs
del CreateShortcut.vbs
win+R可以打开cmd,右键属性,查看cmd编码是否与bat文件相同
cmd编码为ANSI
将bat也另存为ANSI
至此大功告成
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。