站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Javascript 专题使用Shell.Application技术之二

使用Shell.Application技术之二

摘要: 使用Shell.Application技术之二


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){
//