LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lp.RemoveDir - Remove a directory from the Windows file system

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.


value = lp.RemoveDir('path');


The lp.RemoveDir LUA function remove a directory from the Windows file system.


'path'                        The path and name of the directory to delete

Warning  ! If you want to use the \ character in the path ypu should use the \\ instead. The \ character is use for escape sequence only in LUA.

Return Values

value            A boolean value of the status

0             If the directory is deleted

-1           If is not deleted

nil                 Return nil if an error occurs


Supression of c:\newdir

value = lp.RemoveDir("c:\\newdir");

lp.Print("Result : ",value);

 directory supression

 If we launch the script a second time then we get an error because the directory doesn't exist.

directory supression