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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELETE Folder / Copy Files?

Status
Not open for further replies.

stephenmbell

IS-IT--Management
Jan 7, 2004
109
US
I have the following structure on my drive

C:\MyFolder\Myfolder1\myfile
C:\MyFolder\Myfolder2\myfile

These files are in place as a backup copy of a data file should it ever corrupt.

The structure of the datafile is changing with a new software upgrade and I have new ones. I am trying to delete the existing folder/files and replace it using a script.

I have been running into permission errors, so I have stripped the script:

dim objFSO
set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("C:\MyFolder")
set objFSO = Nothing

I still get a permission denied error

For testing, I am running on my local machine, which I have admin privileges on


Any light to be shed on this????

Thanks in advance

sb

 
What if you try:
Code:
objFSO.DeleteFolder "C:\MyFolder", True

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Thank you, that worked beautifully.

What does that True parameter do? Subfolders? Delete non empty?
 
as phv says, True indicates "force" the delete even if hell breaks loose.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top