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
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)
Please log in to answer
Posted by:
Garrett
19 years ago
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.
so that the conversation will remain readable.