X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: =?ISO-8859-1?Q?Rafael_Garc=EDa?= Newsgroups: comp.os.msdos.djgpp Subject: deleting subdirectories Date: Fri, 01 Oct 2004 13:29:27 +0200 Organization: Telefonica Data Espagna Lines: 19 Message-ID: NNTP-Posting-Host: 100.red-80-34-252.pooles.rima-tde.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nsnmpen3-gest.nuria.telefonica-data.net 1096630280 15546 80.34.252.100 (1 Oct 2004 11:31:20 GMT) X-Complaints-To: usenet AT nsnmpen3-gest DOT nuria DOT telefonica-data DOT net NNTP-Posting-Date: Fri, 1 Oct 2004 11:31:20 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: es-es, es To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I need a function to delete a subdirectory tree including files. I tried using system("rd /s/q unziptmp") but this does not work. It seems system() tries to do the job but it doesn't know "/s" parameter. Well, I only want to let the command interpreter do it so I used "cmd /c rd /s/q unziptmp". This is working in WinXP but I need to run it now in a Windows NT system and it does not work. I get this message: "La sintaxis del comando no es correcta", in english something like "Incorrect command syntax". I tried to write a "deltree.bat" with "rd /s /q %1" but it's the same. Then I tried with "cmd /c rd /s /q %1" in "deltree.bat" and yes, this works. But it is so ugly... Anyone has a better idea? Thanks