欢迎来到天天文库
浏览记录
ID:51493121
大小:253.42 KB
页数:26页
时间:2020-03-25
《Windows脚本编程核心技术精解Chapter16.pdf》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、4684-8ch16.f.qc3/3/009:40AMPage483Chapter16GettingSystemInformationInThisChapterDeterminethelocationofWindowsspecialfolderssuchasDesktopandMyDocumentsDeleteyourDocumentsmenutoensureprivacyDeletereferencestodocumenttypesyoudon’tworkwithanywayFindoutimportantnetworkingdetailssuchasusername
2、andcomputernameRetrievememorystatisticsanddeterminecurrentworkload,physicalmemory,andvirtualmemorymanagementdetailsDetectwheelmouse,soundcard,andbootmodeRetrievecurrentvideoresolutionandchangeresolutionandvideorefreshrateon-the-flyListallinstalledfontsandcreateyourpersonalfontsamplerpage
3、AnalyzeyourprocessortypeandWindowsversionFindoutifspecificDLLfunctionsareavailableonyoursystemScriptdevelopersneedinformation.Thischapterprovidesmethodstoretrieveallkindsofinformationaboutyoursystem,yourconfiguration,andyourinstallationfolders.FindingOutImportantPathInformationWheredoesWin
4、dowslive?ThetruenameoftheWindowsfoldermayvaryfromsystemtosystem,andsodothenamesofalltheotherspecialfoldersWindowsuses.Foryourscripts,it’sextremelyimportanttoknowthespecialWindowsfolderlocations.MaybeyouwanttoinsertyourscriptintotheStartUpprogramgrouptostartitautomaticallyatlogon.Ormaybeyoune
5、edaccesstotheRecentDocsfoldertodeletereferencesyoudon’tneed.ThefollowingsectionsdemonstratehowtoretrievethepathnamesofallyourspecialWindowsfolders.4684-8ch16.f.qc3/3/009:40AMPage484484PartIV:AccessingtheOperatingSystem■■RetrievingspecialfolderpathnamesTheWScript.Shellobjectisyoursolution.Ito
6、fferstheSpecialFodersmethod.ThismethodreturnstheactualpathnameofanyspecialWindowsfolder(seeFigure16-1).Here’showtoretrievethepathtoyourprogramgroups(thegroupsyouseewhenyouopenProgramsintheStartmenu):‘16-1.VBSsetwshshell=CreateObject(“WScript.Shell”)path=wshshell.SpecialFolders(“Programs”)Msg
7、Box“ThepathtoyourprivateProgramsfolder:”&vbCr&pathFigure16-1:RetrievepathnamesofspecialWindowsfolders.OnWindows98,NT,and2000,theremaybeindividualuserprofiles.ThisiswhytheseWindowsversionsdividemanyusersettingsintoprivatesettingsandcommonsettingstha
此文档下载收益归作者所有