View previous topic :: View next topic |
Author |
Message |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Fri Mar 11, 2011 3:11 pm Post subject: start_process@ |
|
|
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 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Mar 11, 2011 4:43 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Mar 12, 2011 8:43 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Mar 12, 2011 10:26 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Sat Mar 12, 2011 1:37 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sat Mar 12, 2011 6:06 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
|