/build/static/layout/Breadcrumb_cap_w.png

how to delete files in user profile

hello

 

I want to delet files in user profile but use system accoutnd how can i do it?


0 Comments   [ + ] Show comments

Answers (3)

Posted by: Arminius 12 years ago
Second Degree Green Belt
2

I did it in Winbatch, but here's the overall logic:

check in HKLM\Software\Microsoft\Windows NT\CurrentVersion\profilelist to get a list of profiles and SIDS known on the PC

Then check out Software\Microsoft\Windows NT\CurrentVersion\Profilelist\[SID]\profileimagepath to see where those profiles point

If the SID is less than 20 characters in length, ignore it. Otherwise, use that path to check if the folder you want to delete exists, and if so, delete it.

the nice thing about finding these pieces of info in the registry is that you get the SIDS out of this, so if you have other work to do (like cleaning up ActiveSetup), you already have SIDS and IDs associated with one another.  Also, that gives you the path so you don't need to worry about XP vs Win 7.

Posted by: andemats 12 years ago
2nd Degree Black Belt
1

A simple DOS command, I use for this is:

C:

CD "Documents and Settings"

DEL /F /S /Q "FileName.extension"

(Or C:\Users for Win7)

  • /F - Force deleting of read-only files.
  • /S - Delete specified files from all subdirectories.
  • /Q - Quiet mode, do not ask if ok to delete on global wildcard
Posted by: jagadeish 12 years ago
Red Belt
1

You can write VBScript to delete files from <UserProfile>..

Find out what are the folders available in C:\Users folder...(If you are working on >Windows XP)

Ignore the Default folders... like Public, Administrator, Default etc..

Based on that you can delete files from each user profile if it exists..

 


Comments:
  • And run this script in Active Setup. - piyushnasa 12 years ago
    • and if you don't want a log off trying enuremuting the HKEY_USERS registry key to delete the user specific file from the logged in user and then active setup would take care of the remaining stuff ...

      If you want to make use of the deployment tool and then run the required script with user context(No need to any log off or active setup here) - sumitsingh1984 12 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ