Share via


DeleteFile

Deletes the specified file.

function DeleteFile( 
   oFSO, 
   strFile  
) 

Parameters

  • oFSO
    The file system object.

  • strFile
    The name of the file to be deleted.

Remarks

Call this function to delete the specified file.

Example

// Declare a temporary file.
var strFile = strTempFolder + "\\" + strTarget;
var strClassName = strTarget.split(".");
wizard.AddSymbol("SAFE_CLASS_NAME", strClassName[0]);
wizard.AddSymbol("SAFE_ITEM_NAME", strClassName[0]);

// Declare the template name.
var strTemplate = strTemplatePath + "\\" + strTpl;

// Render and insert the template.
wizard.RenderTemplate(strTemplate, strFile, bCopyOnly);

// Create a new project file and add the file from the template.
var projfile = projItems.AddFromTemplate(strFile, strTarget);

// Delete the temporary file from the file structure object.
DeleteFile(fso, strFile);

See Also

Tasks

Creating a Custom Wizard

Concepts

Customizing C++ Wizards with Common JScript Functions

Designing a Wizard

Other Resources

JScript Functions for C++ Wizards