VBS获取系统路径

1 Set fso = CreateObject("Scripting.FileSystemObject")
2 path = fso.GetSpecialFolder(0)

GetSpecialFolder可以传几个参数,如下:

Constant Value Description
WindowsFolder 0 The Windows folder contains files installed by the Windows operating system.
SystemFolder 1 The System folder contains libraries, fonts, and device drivers.
TemporaryFolder 2 The Temp folder is used to store temporary files. Its path is found in the TMP environment variable.
posted @ 2007-11-22 14:31  CoderZh  阅读(1550)  评论(0编辑  收藏  举报