Get the App
SLTechnology News&Howtos  ›  Development  › 

The use of GetSpecialFolder method under VBS

Shulou Source: shulou.com Published: 2022-06-03 19:38:57 11月12日 Update

This article mainly explains "the use of GetSpecialFolder method under VBS". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the use of GetSpecialFolder method under VBS".

Returns the specified special folder.

Object.GetSpecialFolder (folderspec)

Parameter object

Required. Should be the name of FileSystemObject.

Folderspec

Required. The name of the special folder to return. It can be any constant listed in the Settings section.

Set up

Folderspec can be the following values:

The constant value describes the WindowsFolder0Windows folder, which contains the files installed by the Windows operating system. The SystemFolder1System folder, which contains libraries, fonts, and device driver files. TemporaryFolder2Temp folder, which is used to save temporary files. The path to this folder can be found in the TMP environment variable. Description

The following example illustrates how to use the GetSpecialFolder method:

Dim fso, tempfileSet fso = CreateObject ("Scripting.FileSystemObject") Function CreateTempFile Dim tfolder, tname, tfile Const TemporaryFolder = 2 Set tfolder = fso.GetSpecialFolder (TemporaryFolder) tname = fso.GetTempName Set tfile = tfolder.CreateTextFile (tname) Set CreateTempFile = tfileEnd FunctionSet tempfile = CreateTempFiletempfile.WriteLine "Hello in the World" tempfile.Close Thank you for reading, that's the content of "the use of GetSpecialFolder method under VBS". After the study of this article, I believe that you have a deeper understanding of the use of the GetSpecialFolder method under VBS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Files folders methods learning special content name operating system world hello examples parameters variables fonts that is constants ideas situations numerical values articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Information Apple Linux Huawei