/build/static/layout/Breadcrumb_cap_w.png

Delete a file in Multiple unknown places

Hi all,

I have a file, an ini file it is, that is created when a user starts up a certain app.

The ini file is created in C:\document and settings\"User"\application data\"App name"

It is created for each user that logs onto the machine. Therefore it is a unique folder for the app name but not for the User

I am working out a process to uninstall the app and I need to remove this folder for each user that has logged onto the machine.

Has anyone had this scenario and have you a solution with Netinstall or a script.

Thanks

Scott

0 Comments   [ + ] Show comments

Answers (1)

Posted by: Garrett 18 years ago
Orange Belt
0
This vbscript will loop through every folder under 'C:\Documents and Settings'. You have to leave 'On Error Resume Next' to make sure the script doesn't bomb out in case either the folder/file doesnt exist or if the script doesnt have permissions to delete the file.


On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\Documents and Settings")
Set colSubfolders = objFolder.Subfolders
For Each Folder in colSubFolders
objFSO.DeleteFile folder.path & "\the\path\to\the\file.txt",1
'folder.path = C:\Documents and Settings\<UserName>
Next

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
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