Silverfrost Forums

Welcome to our forums

start_process@

11 Mar 2011 2:11 #7898

I want to remove a directory with 'rmdir xxxx /s /q' and want to do this from within a programme. It is possible with cissue@, but it fails using start_process@. I think that I need the correct syntax but I don't find it. Can anyone help me?

Thanks and best regards Wilfried

11 Mar 2011 3:43 #7900

You might be able to run cmd.exe, possibly with /p (or something) and then the command.

There will also probably be a Windows API function that will do this directly.

12 Mar 2011 7:43 #7901

If I use start_process@('cmd.exe','rmdir /s /q') then only a DOS window opens. I've tried a lot of variations but nothing works. RMDIR has the opprtunity that you can delete a directory even if it is not empty. The Windows API function RemoveDirectory only works if you first delete all files (and subdirectories), so it causes a lot of work before the directory is deleted.

12 Mar 2011 9:26 #7902

I think that there is a command switch that you need to use with cmd.exe. You will need to look up the instructions for cmd.exe. Yes Google does it again!

cmd.exe /c rmdir xxxx /s/q

You may need quotes etc.

12 Mar 2011 12:37 #7904

Thank you, Paul!

Now I have the exact syntax, and it works perfectly: j = start_process@('cmd.exe /c','rmdir xxxx /s /q')

Regards - Wilfried

12 Mar 2011 5:06 #7906

The equivalent mkdir operation is catered for by a standard routine in the FTN77 library. I could have sworn that rmdir was there, but on looking, it isn't, although there is a rename subroutine and an attach subroutine and many others all potentially useful.

Experience suggests that those old routine still work.

Eddie

Please login to reply.