通过Vbscript在桌面上创建文件夹

通过Vbscript在桌面上创建文件夹,vbscript,directory,desktop,Vbscript,Directory,Desktop,我有2个脚本,但无法组合它们 创建文件夹脚本 Option Explicit Dim objNetwork, objComputer Dim objFSO, objFSOText, objFolder, objFile Dim strDirectory, strFile, MakeObject strDirectory = "Folder" Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExis

我有2个脚本,但无法组合它们

创建文件夹脚本

Option Explicit
Dim objNetwork, objComputer
Dim objFSO, objFSOText, objFolder, objFile
Dim strDirectory, strFile, MakeObject

strDirectory = "Folder"
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists(strDirectory) Then
Wscript.Echo strDirectory & " already exists"
Else
'Below is the added line
Set objFolder = objFSO.CreateFolder(strDirectory)
Wscript.Echo "The folder " & strDirectory & " has just been created"
End if

Wscript.Quit
桌面路径脚本

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
wscript.echo(strDesktop)
是否有人可以帮助我?

用于组合桌面文件夹路径和预期(子)文件夹(名称):


你到底在努力解决哪一部分?谢谢Ekkehard。Horner,但如果我尝试运行它,会出现“WshShell undefined”错误,我是新手,可能是我的失败
>> Set objFSO = CreateObject("Scripting.FileSystemObject")
>> Set WshShell = WScript.CreateObject("WScript.Shell")
>> strDirectory = "Folder"
>> strDirectory = objFSO.BuildPath(WshShell.SpecialFolders("Desktop"), strDirectory)
>> WScript.Echo strDirectory
>>
C:\Documents and Settings\eh\Desktop\Folder