本帖最后由 pcl_test 于 2016-7-13 15:05 编辑
- //&cls&cscript -nologo -e:jscript "%~f0"&pause&exit
-
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var ws = new ActiveXObject('Wscript.Shell');
- var sa = new ActiveXObject('Shell.Application');
- var linkname = 'My Computer.lnk';
-
- var fd = fso.GetFile(WSH.ScriptFullName).ParentFolder.Path;
- var link = ws.CreateShortcut(fd+'\\'+linkname);
- link.TargetPath = '%windir%\\explorer.exe';
- link.Arguments = '/e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}';
- link.IconLocation = "%windir%\\System32\\imageres.dll,104"
- link.Save();
-
- var Folder = sa.Namespace(fd);
- var FolderItem = Folder.ParseName(linkname);
- var ItemVerbs = FolderItem.Verbs();
- for(var i=0; i<ItemVerbs.Count; i++){
- if (/定到任|to\s*taskbar/i.test(ItemVerbs.Item(i).Name))ItemVerbs.Item(i).DoIt();
- }
- fso.DeleteFile(fd+'\\'+linkname);
复制代码
|