How to check for a file and delete it
|Article:HOWTO3087|||||Created: 2006-04-04|||||Updated: 2007-05-17|||||Article URL http://www.symantec.com/docs/HOWTO3087|
How do I check for a file and delete it, if found?
Use a Wisescript custom action to either search for a file or use Check if File/Dir exists, then delete file. Use a Set Variable custom action for the path to the file that should be searched for and also in the Delete File action.
For Example: Set Variable TEST to C:\TEST
Check if File/Dir exist then
If File or Directory exists %TEST%\File.txt
Delete File(s) %TEST%\File.txt
The Check if File/Directory exists action gives you the ability to Display a message only, Start an While loop or Start Block as shown above or abort the installation.
Article URL http://www.symantec.com/docs/HOWTO3087