Link to home
Start Free TrialLog in
Avatar of belk979
belk979

asked on

Deleting files

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?
Avatar of belk979
belk979

ASKER

Adjusted points to 200
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.
Avatar of belk979

ASKER

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.
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
Avatar of belk979

ASKER

I created some files using visual basic. ("Add-in")
Are you talking about tables in an Access database?
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.
Avatar of belk979

ASKER

In a database grid.
ASKER CERTIFIED SOLUTION
Avatar of Dr. Kamal Mehdi
Dr. Kamal Mehdi
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One last thing,
In order to delete the files, they must be valid filenames including the full path of the files.
Avatar of belk979

ASKER

Thank You!
You are welcome, belk979.
Have a nice day.