The information in this article applies to Prism Deploy v.10 and newer.
This article describes how to create a Prism script task that scans a computer for all files of a specific type and removes them. This can be useful when you need to scan your network for offensive or unwanted files such as torrents, mp3s, etc.
The computer will search for all files of a certain file type in a location that you specify and then create a package to remove them. After creating the package, it will run that package to remove those specific files. In my step by step instructions, I will be using the example of removing all .mp3 files from the C drive.
Creating the PWI file
1) Open the Prism Deploy Editor. If the Package wizard starts, cancel out of it.
2) Select Package > Take Picture. Select Take a Customized Picture from the list and select Next.
3) In the Custom Picture Options page select the More button to expand the view. On the far right, select New which will bring up a new box.
4) Here you will be able to specify the type of file as well as the area that you want to search for the particular file. Under the drop down box labled Look In: you can select the area on the computer that you will search for. In my example I am going to select C:\ to search the C: drive for my specific files. The next area to look at is the For Files: drop down menu which will allow us to select the particular file extensions we want to search for. In my example I am looking for any files that end in the .Mp3 extension so I am going to edit the box to search for *.mp3
5) In the drop down box located to the right of For Files:, you will need to set it to File Information which will scan the metadata of the files for your information, rather than using the file contents. After this is set, click OK
6) In the Custom Picture Options select Save. This will save the file as a PWI. Make sure to save it in a location that your clients will be able to access from a network location. In my example I will use the name MP3_Delete.PWI
Creating the PWF file
Now that the PWI file is created, we will need to create a blank PWF file that will be used to help each computer evaluate their own file system for the unwanted files.
1) With the Custom Picture Options page still open, delete all entries under the Additional Options list. After this is done, check the checkbox on the left side that says Recent Documents and select Next. This will save the file as a blank PWF. Make sure to save it in the same location as the PWI.
2) Once the PWF is done saving, make sure that the checkbox Open file in editor is checked and select OK. This will open up the PWF for editing. On the left window, right click in the white space and select New > Computer. Right click again and add the C: drive. (Note: If you are searching a different drive other than C: for these files, you will need to add that instead)
3) Close the Prism Deploy Editor
Creating the Prism Script
Now that both the PWI and PWF file have been created, the last step is to create a Prism Script task to run a script. This script will use the PWI and PWF files to search the local computer for the specific files in the chosen location and create a second PWF file. Next the script will compare the two PWF files and create a Package that will remove all of the files it found that fall within the parameters we set when setting up the PWI. Last the script will run the package to remove those particular files.
Below you will find a link to a script named MP3_Delete.pts
You will need to modify it to fit your environment based on the location and naming scheme of your PWI and PWF files.
Optionally provide your comments to help us improve this article...
Thank you for your feedback!