Search for file using WiseScript

book

Article ID: 179448

calendar_today

Updated On:

Products

Symantec Products

Issue/Introduction

 

Resolution

Question
How do I search for a file on the destination computer and delete it if it is found?

Answer

Using WiseScript, create a script using the Search For action which locates and then deletes the file in question using a Delete Files action:

  1. Add a Search for file TEST.txt place in Variable FOUND. Select Return first File that matches from the Return Type drop-down. 
  2. Add an If statement that checks to see if FOUND is populated with a value.
  3. Use a Delete Files action to delete the file.

    If FOUND Not Equal "" then
       Delete File(s) %FOUND%
    End