ScriptSpot home

Forum topic · General Scripting

Delete folder

By Aline3D · 2007-02-28

Description

Hi friends,

I have some problem, i need delete folder but not have code in maxscript for this.

:(

 PS: they had understood? my english is very very bad😳

 

 

Comments (5)
3dwannab

HiddenDOSCommand

Lets not forget the HiddenDOSCommand which runs in the background. No annoying flash on your screen.

slimatron

folder deletion

Even neater, try the dotnet method:

fileClass = dotNetClass "System.IO.Directory"
fileClass.Delete @"c:\directoryName" true

true sets the deletion to recursive so you delete all the files and subfolders
simples...

Reply to slimatron
Branko Živković

ei.


fn deleteFolder folderPath: =
(
local sioDir = dotNetClass "System.IO.Directory"
if (SIODir.Exists folderPath) do SIODir.Delete (folderPath) true
)
--example
deleteFolder folderPath:"c:\\temp\\TestFolder"

arketip

You could try the DOSCommand()

Something like this:

DOSCommand "rd c:\\theFolder"

Don't forget to use a double \\ in the path name because the command is a filename string