File.RemoveDir
Skip to content
mnscript
StringResult File.RemoveDir(string, string) 

Description ​

Deletes a directory.

Arguments ​

string - The directory to search.
string - The directory to delete.

Returns ​

StringResult - A StringResult representing the success/failure of the operation.

Example ​

msc
using File;
using Console;
using System;
using Application;

// Requests Admin Permission 
Application.RequestAdminPrivilege();

// Deletes "Files" in "r/programs".

StringResult result = File.RemoveDir("r/programs", "Files");

if(result.GetResult()){
    Console.WriteLine("The directory was deleted!");
}else{
    // If the directory could not be deleted, the result string contains the reason.
    Console.WriteLine("Error: "..result.GetString());
}