Ok,
I am very new at this and trying to learn about this in the Windows 2000 Scripting Guide about vbScript, wsh, wmi, etc. I downloaded Windows Script 5.6 and installed it. I copied this script and changed the folder I wish to delete for practice as Scripts in the C: drive.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("SELECT * FROM Win32_Directory WHERE Name = 'c:\\Scripts'")
For Each objFolder in colFolders
errResults = objFolder.Delete
Wscript.Echo errResults
Next
or this script:
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("C:\Scripts")
pause
But all I get is nothing but an error such as this:
'objFSO.DeleteFolder' is not recognized as an i
operable program or batch file.
I feel like there is a dll or library file or program that is not installed in my win2k machine.
So what am I missing. All help is appreciated. Thanks
I am very new at this and trying to learn about this in the Windows 2000 Scripting Guide about vbScript, wsh, wmi, etc. I downloaded Windows Script 5.6 and installed it. I copied this script and changed the folder I wish to delete for practice as Scripts in the C: drive.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("SELECT * FROM Win32_Directory WHERE Name = 'c:\\Scripts'")
For Each objFolder in colFolders
errResults = objFolder.Delete
Wscript.Echo errResults
Next
or this script:
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("C:\Scripts")
pause
But all I get is nothing but an error such as this:
'objFSO.DeleteFolder' is not recognized as an i
operable program or batch file.
I feel like there is a dll or library file or program that is not installed in my win2k machine.
So what am I missing. All help is appreciated. Thanks