p;com实现
Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\学习天地.lnk")
2.4. Win没提供cli格式的方法
3.
4. Attilax的总结
使用ini格式的url算兰..
5. Ref
java创建快捷方式(作者 ice古雨) - - ITeye技术网站.htm
(转)创建快捷方式到桌面的脚本命令_singularpoint_新浪博客.htm
Internet快捷方式-vivieu-ChinaUnix博客.htm
命令行创建快捷方式-vivieu-ChinaUnix博客.htm
CoCreateInstance_百度百科.htm
CoCreateInstance具体内部实现 - IT民工 - 博客频道 - CSDN.NET.htm
6. Winapi code
hr = CoCreateInstance(CLSID_ShellLink, NULL,
CLSCTX_INPROC_SERVER, IID_IShellLink, (void**)&pisl);
IPersistFile* pIPF;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//这里是我们要创建快捷方式的原始文件地址
pisl->SetPath("c:\\windows\\notepad.exe");
hr = pisl->QueryInterface(IID_IPersistFile, (void**)&pIPF);
if (SUCCEEDED(hr))
{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//这里是我们要创建快捷方式的目标地址
pIPF->Save(L"c:\记事本.lnk", FALSE);
pIPF->Release();
h = CoCreateInstance( CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_IShellLink, (PVOID*)&shellLink );
if (FAILED(h)) {
errStr = "Failed to create IShellLink";
goto err;
}
h = shellLink->QueryInterface(IID_IPersistFile, (PVOID*)&persistFile);
if (FAILED(h)) {
errStr = "Failed to get IPersistFile";
goto err;
}
7. --end