求教调用桌面快捷方式的方法

乐在梦想成真 2004-07-19 11:03:51
我想用脚本实现打开'我的电脑','我得文档','网上邻居','控制面板','回收站'等桌面快捷方式,我该怎么实现?

请各位多多指教!!谢谢!!
...全文
131 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
gjd111686 2004-07-21
  • 打赏
  • 举报
回复
<script>
function ExeRun(command)
{
window.oldOnError=window.onerror;
window._command=command;
window.onerror=function(err)
{
if(err.indexOf('automation')!=-1)
{
alert("命令"+window._command+"已经被用户禁止!");
return true;
}
else return false;
}
var wsh=new ActiveXObject("WScript.Shell");
if(wsh)
wsh.Run(command);
window.onerror=window.oldOnError;
}
</script>
<input type=button onclick="ExeRun('Explorer /n')">
<input type=button onclick="ExeRun('Explorer /e')">
<input type=button onclick="ExeRun('Explorer /e,/root,\\DigitalTitan')">
<input type=button onclick="ExeRun('Explorer /select,C:\\WinNT\\')">
<textare rows=10 cols=80%>
explorer的命令行参数
Command-Line Switches for Windows Explorer

Q130510


--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Windows 95
Microsoft Windows NT Server version 4.0
Microsoft Windows NT Workstation version 4.0

--------------------------------------------------------------------------------


SUMMARY
This article lists command-line switches you can use when you start Windows Explorer (EXPLORER.EXE).


MORE INFORMATION

Syntax
EXPLORER.EXE [/n][/e][,/root,<object>][[,/select],<sub object>]
Switches

/n: Opens a new window in single-paned (My Computer) view for each item
selected, even if the new window duplicates a window that is
already open.

/e: Uses Windows Explorer view. Windows Explorer view is most similar
to File Manager in Windows version 3.x. Note that the default view
is Open view.

/root,<object>: Specifies the root level of the specified view. The
default is to use the normal namespace root (the
desktop). Whatever is specified is the root for the
display.

/select,<sub object>: Specifies the folder to receive the initial
focus. If "/select" is used, the parent folder
is opened and the specified object is selected.
Examples
To open a Windows Explorer view to explore only objects on \\<server name>, use the following syntax:
explorer /e,/root,\\<server name>


To view the C:\WINDOWS folder and select CALC.EXE, use the following syntax:
explorer /select,c:\windows\calc.exe



Additional query words: 4.0 parameters

Keywords : win95
Issue type :
Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400


Last Reviewed: December 14, 2000
? 2001 Microsoft Corporation. All rights reserved. Terms of Use.



</textare>
gjd111686 2004-07-21
  • 打赏
  • 举报
回复
<script>
//记事本
var WshShell=new ActiveXObject("WScript.Shell");
var strDesktop=WshShell.SpecialFolders("桌面");
var Link=WshShell.CreateShortcut(strDesktop+"\泰利达办公助手.lnk");
Link.TargetPath="%windir%\\Notepad.exe";
Link.IconLocation="%windir%\\system32\\SHELL32.DLL,41";
Link.Save();
//按钮
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Internet Explorer\\MenuExt\\","");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Internet Explorer\\MenuExt\\泰利达在线支持\\","Http://DigitalTitan:9003/");
WshShell.RegWrite("HKCU\\Software\\Microsoft\\Internet Explorer\\MenuExt\\泰利达在线支持\\Contexts",0xF3,"REG_DWORD");
</script>
乐在梦想成真 2004-07-21
  • 打赏
  • 举报
回复
拜托,我都说了这种方法不好使,他们打开的都是‘我的电脑’,我想求教其他的方法。

谢谢回复!!!
woyingjie 2004-07-19
  • 打赏
  • 举报
回复
<a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}">我的电脑</a>
<a href="file:///::{208D2C60-3AEA-1069-A2D7-08002B30309D}">网上邻居</a>
<a href='file:///::{450D8FBA-AD25-11D0-98A8-0800361B1103}"'>我的文档</a>
<a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}/::{21EC2020-3AEA-1069-A2DD-08002B30309D}">控制面板</a>
<a href="file:///::%7B645FF040-5081-101B-9F08-00AA002F954E%7D">回收站</a>
wangxiaomax 2004-07-19
  • 打赏
  • 举报
回复
下面的算不算javascript实现?关注中

//'Document'
window.open("file:///::{450D8FBA-AD25-11D0-98A8-0800361B1103}","","");
//'Computer'
window.open("file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}","","");
//'NetWork'
window.open("file:///::{208D2C60-3AEA-1069-A2D7-08002B30309D}","","");
//'RecycleBin'
window.open("file:///::{645FF040-5081-101B-9F08-00AA002F954E}","","");
乐在梦想成真 2004-07-19
  • 打赏
  • 举报
回复
我都说了,这种方法不好使,我想用javascript实现,求教!!

87,992

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧