获取当前临时目录路径的VB技巧:
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
在VBScript中失败。所以?
发布于 2009-01-08 14:05:01
WScript.CreateObject("Scripting.FileSystemObject").GetSpecialFolder(2)
我花了一段时间才在谷歌上找到它。所以下一个和我一样的人...
发布于 2009-01-08 14:09:44
Const WindowsFolder = 0
Const SystemFolder = 1
Const TemporaryFolder = 2
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim tempFolder: tempFolder = fso.GetSpecialFolder(TemporaryFolder)
发布于 2009-01-08 14:30:12
另一种可能性是:
CreateObject("WScript.Shell").ExpandEnvironmentStrings("%Temp%")
https://stackoverflow.com/questions/424331
复制相似问题