Remove Directory HELP !

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
itbusiness
Newbie
Posts: 1
Joined: Tue Jun 23, 2009 3:43 am

Remove Directory HELP !

Post by itbusiness »

Please , i need to use DOS Command Rmdir /Q /S
from quickbasic 7.1 extended.

Every time i try with Shell"rmdir /Q /S C:\xxxxx"
quickbasic will use RMDIR internal language command and not the DOS RMDIR command.

Help appreciated.
Mrusso italy
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

TRY RD

Post by burger2227 »

What's the difference? You don't need to use SHELL, but if you want to then try RD instead. SHELL "RD C:\XXXX /S /Q".

RMDIR [drive:]path
RD [drive:]path

Windows 2000 and Windows XP Syntax.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree.
/Q Quiet mode, do not ask if ok to remove a directory tree with /S. S MUST come first!

Examples

rmdir c:\test

Remove the test directory, if empty. If you want to delete directories that are full, use the deltree command or if you're using Windows 2000 or later use the below example.

rmdir c:\test /s

Windows 2000, Windows XP and later versions of Windows can use this option with a prompt to permanently delete the test directory and all subdirectories and files. Adding the /q switch would suppress the prompt.

I have to wonder how you know that it is using the RMDIR internal command?
Last edited by burger2227 on Tue Jun 23, 2009 11:36 pm, edited 1 time in total.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Anonymous

Post by Anonymous »

You could also try running a batch file with rmdir /Q /S C:\xxxxx in it

Shell "DelDir.bat"
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

I DON'T see a need for a batch file! SHELL should work just fine.

I wonder how the poster even knows that the PDS command was used instead of the shell statement. Neither asks for a user input! Both are deadly.........

I'd like to know HOW he can even say that!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply