标题: [文本处理] bat创建快捷方式的的问题 [打印本页]
作者: 一步莲华 时间: 2017-12-29 12:42 标题: bat创建快捷方式的的问题
set a=%~dp0vmware.exe -x
set b= %~dp0vmwarexuniji\centos.vmx
set c="%a%%b%"
echo 创建快捷方式
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""AllUsersDesktop"")
& ""\VMware.lnk""):b.TargetPath="%c%":b.WorkingDirectory=""%~dp0\"":b.Save:close") >nul
echo.
pause
想给目标加一个参数 但是怎么改都会报错,求大神支招...感激不尽
作者: search_Sudoku 时间: 2017-12-29 14:54
回复 1# 一步莲华
保存为 VBS 文件- Set fso = CreateObject("Scripting.FileSystemObject")
- GetTheParent = fso.GetParentFolderName(WScript.ScriptFullName)
- Set WshShell = WScript.CreateObject("WScript.Shell")
- AllUsersDesktop = WshShell.SpecialFolders("AllUsersDesktop")
- Set b = WshShell.CreateShortcut(AllUsersDesktop & "\VMware.lnk")
- b.TargetPath = "" & GetTheParent & "\vmware.exe"
- b.Arguments = "-x """ & GetTheParent & "\vmwarexuniji\centos.vmx"""
- b.WorkingDirectory = GetTheParent
- b.Save
- WScript.Quit
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |