使用Shell.Application技术之二 (转)

使用Shell.Application技术之二 (转)[@more@]

 function FileSearch()
 {
 SearchAsst = new ActiveXobject("SearchAssistantOC.SearchAssistantOC");
  SearchAsst.FindFilesOrFolders();

  //shellApp = new ActiveXObject("Shell.Application");
 //ShellApp.ShowBrowserBar("{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}", true);
 //与上效果相同
 }

 function PersonSearch()
 {
  SearchAsst = new ActiveXObject("SearchAssistantOC.SearchAssistantOC");
  SearchAsst.FindPeople();
 }

 function ShellExecuteExe()
 { 
  ShellApp = new ActiveXObject("Shell.Application");

  //var myprinterfolder = shell.NameSpace("shell:Printersfolder");
  //var mydocsfolder = shell.NameSpace("shell:personal");
  //var mycompfolder = shell.NameSpace("shell:drivefolder");


 //ShellApp.ShowBrowserBar("{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}", true);

  ShellApp.ShellExecute("cmd.exe");

   //ShellApp.ShellExecute("wiaacmgr.exe","/selectDevice");
 //ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1")
 //ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL.NETcpl.cpl,,1");
 //ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1");

 //对于FolderItems对象可以用InvokeVerbEx Method
 //ShellApp.NameSpace("c:xxx").Items().InvokeVerbEx("delete");
 //而通过InvokeVerb(x.Items().Item(0).Verbs().Item(i).Name);可以访问某个命令
 // win = ShellApp.NameSpace("c:xxx").Items().Item(0)
 // e = win.Verbs();
 // for(i=0;i // document.writeln(e.Item(i).Name);
 // }
 // win.InvokeVerb(e.Item(0).Name);
 }

 //=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 //
 // BindToSA
 //
 // Bind to the specified url and return the cdo object for it.
 //
 function BindToSA(szURL){
 var adModeRead = 1;
   var oDoc = new ActiveXObject("CDO.KnowledgeStartAddress")
   oDoc.Datasource.Open(szURL, null, adModeRead, -1, 0, "", "")
   return oDoc;
 }

 //=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 //
 // BindToUrl
 //
 // Bind to the specified url and return the cdo object for it.
 //
 function BindToUrl(szURL){
 var adModeRead = 1;
   var oDoc = new ActiveXObject("CDO.KnowledgeDocument")
   oDoc.DataSource.Open(szURL, null, adModeRead, -1, 0, "", "")
   return oDoc;
 }


 function Msg(str){
 //
 //var FolderControl = new ActiveXObject("Tahoe.FolderControl");
 FolderControl.TraceMsg(str);
 }


   ShellApp = new ActiveXObject("Shell.Application");
 //ShellApp.ShowBrowserBar("{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}", true);

 //ShellApp.ShellExecute("Rundll32.exe","shell32.dll,SHCreateLocalServerRunDll {601ac3dc-786a-4eb0-bf40-ee3521e70bfb}");

 //ShellApp.ShellExecute("Rundll32.exe","shdocvw.dll,OpenURL");//Internet 快捷方式
 //ShellApp.ShellExecute("Rundll32.exe","mSCOnf.dll,OpenConfLink");//SpeedDial
 //ShellApp.ShellExecute("Rundll32.exe","zipfldr.dll,RouteTheCall");//压缩文件夹shdocvw.dll,OpenURL
 //ShellApp.ShellExecute("Rundll32.exe","netplwiz.dll,UsersRunDll");//用户帐户
 //ShellApp.ShellExecute("Rundll32.exe","shell32.dll,Options_RunDLL 0");//文件夹选项
 //ShellApp.ShellExecute("Rundll32.exe","shell32.dll,Options_RunDLL 1");//显示任务栏和开始菜单

 //ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1")appwiz.cpl,NewLinkHere
 //ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLLAsUser")

  //ShellUI = new ActiveXObject("Shell.UIHelper.1");
 //ShellUI.AddFavorite("microsoft.com/msdn","MSDN'>http://www.microsoft.com/msdn","MSDN")
 //ShellUI.AddChannel("Http://www.microsoft.com")

 

 ShellApp.ShellExecute("c:windowssystem32mshta.exe","C:xx.hta")

 //var s = ShellApp.ShellExecute("rundll32.exe", "kernel32.dll,GetVersionExA"+","+so);


 /*var p = "C:"
   sha = new ActiveXObject("Shell.Application");
 var g = sha.NameSpace(p).Items().Item("xxx");
 var v = g.Verbs();
 var str=null;
 for(i=0;i str = v.item(i).Name;
 if(str.search("重命名")!=-1)break;
 str = null
 }
 if(str)
 g.InvokeVerbEx(str,"c:xx");
 else
 alert('no')
 //g.InvokeVerbEx("重命名","xx");
 */


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752019/viewspace-976516/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10752019/viewspace-976516/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值