| View previous topic :: View next topic |
| Author |
Message |
kopelito Master Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 483
|
Posted: Tue Mar 25, 2008 11:27 am Post subject: [Delphi] Delete directory command? |
|
|
I found this command: RemoveDir('c:\folder').
But somehow it doesnt work, the folder wont be deleted! :S
Are there any other commands? or am I doing something wrong?
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Tue Mar 25, 2008 11:47 am Post subject: |
|
|
Are you trying to remove system files?
|
|
| Back to top |
|
 |
kopelito Master Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 483
|
Posted: Tue Mar 25, 2008 11:50 am Post subject: |
|
|
| Just GameGuard =] (Maplestory..)
|
|
| Back to top |
|
 |
Renkokuken GO Moderator
Reputation: 4
Joined: 22 Oct 2006 Posts: 3249
|
Posted: Tue Mar 25, 2008 11:52 am Post subject: |
|
|
| The contents of the directory are normally required to be empty.
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Tue Mar 25, 2008 12:19 pm Post subject: |
|
|
| Renkokuken wrote: | | The contents of the directory are normally required to be empty. |
yeah, that sucks.
Delete a directory with files (or not) in it:
| Code: | Function DelTree(DirName : string): Boolean;
var
SHFileOpStruct : TSHFileOpStruct;
DirBuf : array [0..255] of char;
begin
try
Fillchar(SHFileOpStruct,Sizeof(SHFileOpStruct),0) ;
FillChar(DirBuf, Sizeof(DirBuf), 0 ) ;
StrPCopy(DirBuf, DirName) ;
with SHFileOpStruct do begin
Wnd := 0;
pFrom := @DirBuf;
wFunc := FO_DELETE;
fFlags := FOF_ALLOWUNDO;
fFlags := fFlags or FOF_NOCONFIRMATION;
fFlags := fFlags or FOF_SILENT;
end;
Result := (SHFileOperation(SHFileOpStruct) = 0) ;
except
Result := False;
end;
end; |
include shellapi; ( i mean use lol )
|
|
| Back to top |
|
 |
kopelito Master Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 483
|
Posted: Tue Mar 25, 2008 12:27 pm Post subject: |
|
|
Can you explain me alittle about this code?
Like how do I direct it to delete a certain folder?
For eg:
I want to delete C:\Nexon\Maplestory
Can you set this code to delete it? then ill see what u changed and know what to do =]
Thank you =]
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Tue Mar 25, 2008 12:30 pm Post subject: |
|
|
| kopelito wrote: | Can you explain me alittle about this code?
Like how do I direct it to delete a certain folder?
For eg:
I want to delete C:\Nexon\Maplestory
Can you set this code to delete it? then ill see what u changed and know what to do =]
Thank you =] |
DelTree('C:\Nexon\MapleStory');
|
|
| Back to top |
|
 |
kopelito Master Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 483
|
Posted: Tue Mar 25, 2008 12:34 pm Post subject: |
|
|
Awwwww
Understood =]
Thanx
|
|
| Back to top |
|
 |
Renkokuken GO Moderator
Reputation: 4
Joined: 22 Oct 2006 Posts: 3249
|
|
| Back to top |
|
 |
|