My intention is to create a new folder via the VBScript method "Folder.NewFolder". However, when running the script below on Windows XP I get the error "800A01A8 - Object required" that refers to the highlighted line.
I'm aware that there is also the possibility to create a new folder with the help of the method "CreateFolder" of the "Scripting.FileSystemObject". Still, I'd like to know why the script above does not work for me on Windows XP. I haven't checked the version of my shell dll yet (e.g. via "DllGetVersion") but I assume that it's gonna be the right one as I use XP that should have shell dll version 6.0. The MSDN documentation says that the method "Folder.NewFolder" requires shell dll version 4.71 or later. Basically, the code itself ought to be correct as when running the script above on Windows Server 2008 everything is fine for me.
Thanks for any help.
Code:
@Prerequisite: .vbs-script is placed in a directory that contains a folder "parentFolder"
@Expected execution result: A folder "childFolder" is created in the folder "parentFolder"
Dim objShell, objFolder
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("parentFolder")
[green]objFolder.NewFolder("childFolder")[/green]
I'm aware that there is also the possibility to create a new folder with the help of the method "CreateFolder" of the "Scripting.FileSystemObject". Still, I'd like to know why the script above does not work for me on Windows XP. I haven't checked the version of my shell dll yet (e.g. via "DllGetVersion") but I assume that it's gonna be the right one as I use XP that should have shell dll version 6.0. The MSDN documentation says that the method "Folder.NewFolder" requires shell dll version 4.71 or later. Basically, the code itself ought to be correct as when running the script above on Windows Server 2008 everything is fine for me.
Thanks for any help.