出于某种原因,以下代码对我不起作用...我正在尝试学习 VBS,并且我一直在拼凑一些来自 Google 资源的代码。我不知道为什么我不能让它工作。
Option Explicit
Dim objNetwork, objComputer
Dim objFSO, objFSOText, objFolder, objFile
Dim strDirectory, strFile, MakeObject
strDirectory = "C:\test"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strDirectory) Then
Wscript.Echo strDirectory & " already exists"
Else
Wscript.Echo "The folder " & strDirectory & " does not exist"
Wscript.Echo "The folder " & strDirectory & " has just been created"
End if
Wscript.Quit