Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting run-time error

Status
Not open for further replies.

brodie1227

Vendor
Feb 19, 2004
76
US
Error: Wrong number of arguments or invalid property assignment: 'fso.DeleteFolder'
Code: 800A01C2

Here is the code. Thanks for the help.

Set fso=CreateObject("Scripting.FileSystemObject")
FSO.DeleteFolder
Set objFolder = FSO.GetFolder("c:\windows\temp")
For Each aFile In objFolder.Files
msgbox "going to delete " & aFile.Name
aFile.Delete
Next
 
Quick suggestion.

Open the Windows Scripting 5.6 Documentation help file and search on fso.deletefolder.

Or read the Error message you posted above. It says that you are sending fso.deletefolder the wrong number of arguments. And you are. fso.deletefolder requires at least one argument, that argument being the path to the folder you want deleted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top