I need a code in vb6 to have a program that will auto-delete all the files in 1 drive in just one click of that program?? can u help me???
You need to use the FileSystemObject of the Scripting Runtime library. See here. This library is not part of the standard VB references by default so remember you will have to find it in the "References" list and check it so that it is added to your project; it is under "References" as "Microsoft Scripting Runtime Library". However bear in mind that calls to delete files from a VB app are high-level requests to the O/S, not direct kernel commands. If you have any kind of file lock contention you won't be able to delete a given file.
The best way to blast an entire drive would be use the DOS 'format' command. You cannot run 'format' though on the system drive, and it will take longer to format a drive than to erase all files, though formatting will really do it. You would use the Shell command in VB to execute the DOS command.
See here and here.
You can also use the Shell command to execute the "del" DOS command recursively against the drive. The FileSystemObject is basically doing that under the covers, so it's not too far away. Finally, you can use API code to do it, though I am guessing you are not quite there yet in your experience. But if so, take a look at these articles:
Posted on Apr 01, 2008
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
Posted on Jan 02, 2017
Tips for a great answer:
May 11, 2010 | Computers & Internet
Jan 27, 2010 | Microsoft Visual Basic 6.0 for PC
Nov 07, 2009 | Microsoft Computers & Internet
Aug 18, 2009 | Microsoft Computers & Internet
Jul 11, 2009 | Microsoft Visual Basic Enterprise Edition...
Mar 20, 2009 | Microsoft Visual Basic Professional...
Mar 15, 2009 | Microsoft Visual Basic 6.0 for PC
Feb 28, 2009 | Microsoft Visual Basic 6.0 for PC
Jan 22, 2009 | Computers & Internet
Dec 12, 2008 | Microsoft Visual Basic 6.0 for PC
270 people viewed this question
Usually answered in minutes!
Step 2: Please assign your manual to a product: