Creating an MSI to delete a file
Hello,
I would like to know how can i delete a file by creating a MSI ?
file is located in C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files\SQM\
Thanks.
-
This is the default profile for *locally created* users, i.e. accounts added to the workstation so, in a corporate environment, who would care what's in there? - anonymous_9363 11 years ago
Answers (5)
Are we missing something here?
Is the OP asking how to remove something from the default user profile? C:\Users\Default
Therefore AS won't be required as it's just one file location required - unless I've read it all wrong :)
Comments:
-
The question is about creating an MSI file in order to delete a file from a user profile path; wouldn't you agree Windows Installer is not the right technology for file removal? - bkelly 11 years ago
-
I agree that Windows Installer could be the right technology (although it could also be achieved by other methods), I just mean that the path quoted by the OP is the Default User profile path and not 'a user profile' path:
C:\Users\Default\....
not
C:\Users\<username>\....
Meaning that ActiveSetup wouldn't be required as it's just one file location and not a location in every user profile.
Maybe I've just read the wrong/differently to everyone else :) - dunnpy 11 years ago-
You are correct dunnpy, I saw AppData and immediately thought profile. In this case Active Setup would probably not work because the default user path is likely protected from a standard user. Any script (batch, VBS, etc) will do the job but it would need to be deployed as an admin (with a systems management system, start up/shut down script, etc.) - bkelly 11 years ago
Ok thanks for your help, however i also can use vbs to do that, because i must use a luncher with vbs inside, so i could add a command line like this :
Set Fso= WScript.CreateObject("Scripting.FileSystemObject" )
If Fso.FileExists("C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files\SQM\myfiletodelete") Then
Set ObjFile = Fso.GetFile("C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files\SQM\myfiletodelete")
ObjFile.Delete
yes ?
I think you would be better off adding something to the logon script to delete the file, as you will have access to the users AppData path at that point. A MSI isnt really ideal for what your trying to achive.
If your not in a domain, so no logon scripts etc. You could add something to the HKLM Run key, this would achive what you require.
In regards to the script, you can use a batch or VB script to do the deleting, if your really fancy you could add some logging in as well.