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!

Deleting User's Profile Folder 1

Status
Not open for further replies.

alfordjj

MIS
Jul 23, 2003
80
0
0
US
I am trying to write a script that will delete a specific user's profile directory from a Windows 2K machine. I found this thread (thread329-579946) but I can't figure out what I'm missing in my code to make it work.

I get an error that says I don't have permission. I'm logged in as an administrator.

Code:
option explicit

Dim fso, path, demofolder

Set fso = CreateObject("Scripting.FileSystemObject")

Path = "c:\Documents and Settings\UserName"

set demofolder = fso.GetFolder(Path)

demofolder.Delete, true

Thanks!!!
 
demofolder.Delete, true
should be:

demofolder.Delete true 'No Comma

Let us know what happens when the script is run with no comma.
 
Ok, I feel stupid. It seems to be working now.

Thanks DTodd83!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top