使用Shell.Application技術之二 (轉)

worldblog發表於2007-12-14
使用Shell.Application技術之二 (轉)[@more@]

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

  //App = 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:Printerolder");
  //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","/Device");
 //ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl,,1")
 //ShellApp.ShellExecute("rundll32.exe", "shell32.dll,Control_RunDLLcpl.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.Data.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){
 //


   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","mnf.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(".com/msdn","MSDN'>","MSDN")
 //ShellUI.AddChannel("")

 

 ShellApp.ShellExecute("c:system32mshta.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/10752043/viewspace-993099/,如需轉載,請註明出處,否則將追究法律責任。

相關文章