欢迎来到天天文库
浏览记录
ID:51491714
大小:332.82 KB
页数:32页
时间:2020-03-25
《Windows脚本编程核心技术精解Chapter09.pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、4684-8ch09.f.qc3/3/009:35AMPage289Chapter9MasteringLinksInThisChapterLearnmoreaboutthepowerofshortcutfilesCreateandmodifyshortcutfilesbyscriptSearchforinvalidlinksandduplicatingkeyboardshortcutsChangeshortcuticonsdynamicallyPreselectashortcut’swindowsizeUsethehiddenShellLink
2、objecttoresolvebrokenlinksDiscovertheundocumentedlinkresolvingmechanismandthenewWindows2000DistributedLinkTrackingServiceOpenashortcuttarget’sPropertiespageMarkashortcuttargetfileintheExplorerNowthatyouknowhowtohandleyourfilesystem,takealookatlinkfiles.Inthischapter,youlearnwha
3、tlinkfilesareandhowtousethemtocustomizemenus.Youalsolearnhowtocreatenewlinkfilesfromscratchandhowtocheckexistinglinkfilesforerrors.UsingsecretAPIfunctions,youcanevenautomaticallyrepairbrokenlinkfiles.WhyDoINeedLinksAnyway?Linksaresmallbutextremelypowerfulfiles.Theyrepresentfiles,f
4、olders,andsystemobjectslocatedsomewhereelse.LinksbuildthefoundationofcustomizingWindows.LinksmaketheProgramsmenuwork.Toseehowimportantlinksreallyare,startasearchfor*.LNK.Scriptscanuselinkstoplacethemselvesinimportantplaces.YoucanaddyourscripttotheStartmenu,placeitintotheSendTofold
5、er,orinsertareferenceintotheStartupfolder.Inaddition,scriptscanusetheirlinkfunctionsformaintenance.Scriptscansearchforlinks,checkwhethertheirdestinationsarestillvalid,andsortoutanybrokenlinks.4684-8ch09.f.qc3/3/009:35AMPage290290PartII:ConqueringtheFileSystem■■Moreimportantly,scri
6、ptscanchecktheinternalkeyboardshortcutsandmakesuretherearenoduplicateentries.Windowsdoesn’tcheckforthis,allowingyoutoassignmultiplekeyboardshortcutstomorethanonelinkfile,oreventooverrideimportantbuilt-inWindowsshortcuts—resultinginerroneousbehavior.ByusingsomeundocumentedWindowsma
7、gic,youcanevenresolvebrokenlinksandmarkfilesandfolders.CreatinganewlinkfileTheWScript.Shellobjectcontainsallthemethodsneededformanaginglinks.ThefollowingexampleasksforanameandplacesashortcuttotheWindowseditorrightonyourdesktop:‘9-1.VBSsetwshshell=CreateObject(“WScript.Shell”)deskt
8、op=wshshell.SpecialFolders(“deskt
此文档下载收益归作者所有