We help IT Professionals succeed at work.

Deleting files

belk979
belk979 asked
on
Medium Priority
162 Views
Last Modified: 2010-05-03
Using a cmd button "delete" I want to place an (*) next to files that I will delete upon exiting my program.  After click on the "exit" command button all files marked with an asterik will be deleted and I will exit the program.  Can someone help me with this coding?
Comment
Watch Question

Author

Commented:
Adjusted points to 200

Commented:
Where is your file (in a list box, text box)?
How is your * added?

If you know the filename, simply use the Kill command against each file you have an astrisk by.

Author

Commented:
I need to know how to place the asterik "*" next to a file using a cmd button called "delete" (caption).  The files are located in a visual basic database.  Then I need to know how to delete all files marked with an asterik through an "exit" cmd button. (supply the code please.)
Be more specific about where your files are. What do you mean by 'located in a visual basic database'?
How are they being listed by your program?
Need more info to help.

Commented:
belk979,
Here is my idea. Sorry I did not have time to get to the code today. If not answered by Sunday, I will try.
Regards
Dalin

pull all the file name to a list box,
Add/remove the "*" in the front of the filename when the user click the filename.

In your exit cmd, loop through the items in the list,
If the first chr is "*" ( use the left function), then delete the file (use kill).
Be more specific about where your files are. What do you mean by 'located in a visual basic database'?
How are they being listed by your program?
Need more info to help.
belk,

if you use a multi-select list box, then your users can ctrl-click to make multiple selections.  then, you can loop through the items in the list box, checking whether .Selected is true.  if it is, then delete the file.

larry

Author

Commented:
I created some files using visual basic. ("Add-in")
Are you talking about tables in an Access database?

Commented:
How are you showing this list of files?  Is it in a list box, database grid, what?  General questions get general answers, specific questions get specific answers.

Author

Commented:
In a database grid.
IT Director / IT Project Manager
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Dr. Kamal MehdiIT Director / IT Project Manager
CERTIFIED EXPERT

Commented:
One last thing,
In order to delete the files, they must be valid filenames including the full path of the files.

Author

Commented:
Thank You!
Dr. Kamal MehdiIT Director / IT Project Manager
CERTIFIED EXPERT

Commented:
You are welcome, belk979.
Have a nice day.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.