/build/static/layout/Breadcrumb_cap_w.png

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.


1 Comment   [ + ] Show comment
  • 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)

Posted by: bkelly 11 years ago
Red Belt
1

I recommend Active Setup as the best way to delete files from user profiles. I just posted a primer on what it is and how it works here: http://www.itninja.com/blog/view/an-active-setup-primer

Posted by: dunnpy 11 years ago
Red Belt
0

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 :)

C:\Users\Default\

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
Posted by: Johnzko 11 years ago
Orange Senior Belt
0

Hey there,

take a snapshot with a tool like appdeploy. Then delete the Files. Take a the "after-snapshot". If you have the MSI you can delete the other Tables in the File. With Appdeploy or Orca.

 

Have Fun.

 

Posted by: tens 11 years ago
Orange Belt
0

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 ?

Posted by: rileyz 11 years ago
Red Belt
0

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.

 
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