DeleteProgramFolder

InstallShield 2016 » InstallScript Language Reference

The DeleteShortcutFolder function supersedes the DeleteProgramFolder function.

The DeleteProgramFolder function deletes a program folder (that is, a subfolder of the Start menu's Programs folder) and its contents, including all shortcuts and all of the program folder's subfolders and their contents. DeleteProgramFolder cannot delete the Programs folder.

Tip • In a Windows Installer based or InstallScript MSI project, this functionality is possibly better achieved by using the native Windows Installer RemoveFolders action. Or, if you are simply uninstalling, the MSI engine natively handles the removal of all files and folders created during the setup. For more information on the RemoveFolders action, see the Windows Installer Help.

Syntax

DeleteProgramFolder ( szFolderName );

Parameters

DeleteProgramFolder Parameters

Parameter

Description

szFolderName

Specifies the name of the folder to remove.

Return Values

DeleteProgramFolder Return Values

Return Value

Description

0

Indicates that the function successfully removed the specified folder.

< 0

Indicates that the function was unable to remove the folder.

You can obtain the error message text associated with a large negative return value—for example, -2147024891 (0x80070005)—by calling FormatMessage.

See Also