本帖最后由 pcl_test 于 2016-7-13 12:27 编辑
- /*&cls
- @echo off
- set "file=程序或快捷方式的完整路径"
- cscript -nologo -e:jscript "%~f0" "%file%"
- pause&exit/b
- */
- var file = WScript.Arguments(0);
- var objShell = new ActiveXObject('Shell.Application');
- var objFolder = objShell.Namespace(file.replace(/[^\\]*$/,''));
- var objFolderItem = objFolder.ParseName(file.replace(/.*\\/,''));
- var objItemVerbs = objFolderItem.Verbs();
- for(var i=1; i<objItemVerbs.Count; i++){
- var str = objItemVerbs.Item(i).Name;
- if (/定到任|to\s*taskbar/i.test(str))objItemVerbs.Item(i).DoIt();
- }
复制代码
|