DeleteFile()

Syntax:

DeleteFile( Filename, MsgBox, Recycle )

Return:

true if the specified file is deleted and false if it is not.

Parameters:

Filename – enter the full pathname of a text file. Filename should be the full pathname of the text file or the alias name given to the file in the Additional Resources tab of the Page Properties or Publication Properties dialog. This parameter is required.

Note:
Pathnames normally contain backslashes e.g. d:\welcome.txt, all single backslashes should be entered as double backslashes i.e. d:\\welcome.txt.

MsgBox – display a warning box asking the user if they are sure they want to delete the file. MsgBox can be true or false. If true the warning box will appear on screen. If false, the warning box will not appear. This parameter is optional and the default is false.

Recycle – send the deleted file to the Recycle Bin. Recycle can be true or false. If true the file is sent to the Recycle Bin. If false, the file is permanently deleted. This parameter is optional and the default is false.

Note:
When using the Recycle Bin, you must use a complete path for the filename (i.e. include drive, directories and filename) otherwise the delete will occur without using the Recycle Bin. It is always a good idea to use full paths to can be certain you are deleting the file you think you are.

Remarks:

This function will delete a specified file from the user’s machine.

This function will only work in the full player - not the screensaver, web plug-in or Flex.

image\Script_Button.jpgExamples