×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Automatic delete files

Automatic delete files

Automatic delete files

(OP)
Hello,

I want a Visual Basic 6.0 program to make the
following handling:

Every week on Sunday morning on 10.00 hour a.m.
the program must delete the files on directory
c:\data.

Who can help me?

Greetings,

mulderm

RE: Automatic delete files

Try using the FileSystemObject. It allows you to perform several tasks on your file system.

Put a timer interrupting from minute to minute and checking if it has reached the pretended hour.
Then you just need to delete the file via FileSystemObject.

Don't forget you must keep the program on for it to execute the task.

RE: Automatic delete files

Couple of things to consider.  Using the System Timer (an API) you can set the timer for much longer intervals than the built-in Timer control.  You may also want to consider using the system Task scheduler to fire off the VB program at the appropriate time.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein

RE: Automatic delete files

You may want to consider using the task manager and a command line batch job.

DEL c:\data\*.*

Simple and no executable programming required.

RE: Automatic delete files

A batch file under Schedules Tasks will be the easiest way under XP

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: Automatic delete files

(OP)
Thank you guys.

But I am new for this.
Can you give me the code for this?
Thank you.

mulderm

RE: Automatic delete files

BillPSU has given you the text for the batch file. Just save it as a textfile called datadel.bat

Then go to Control Panel|Scheduled Tasks|Add new and follow the Wizard. You will need to supply a user name and password for the task to run

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: Automatic delete files

If you needed a solution for your problem, you've just got it from above.
If you want to learn how to code it, Google will have the answers for you. :P

RE: Automatic delete files

(OP)
Thank you guys.
I have make the task and it works perfect.

mulderm

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources