Home > database >  How in the fixed time, delete everything from fixed folder?
How in the fixed time, delete everything from fixed folder?

Time:09-27

Such as: E: \ \, AA in AA folder will not produce some files, need to put the AA at 08:30 folder file delete all, some say with filedelete () function, but can only delete a file, how to delete all files? With what method is more convenient? Not necessarily is written in the code, as long as you can realize this function can be,

CodePudding user response:

Written procedures should be only in the time of execution, such as I need to delete in 08:30 AA data folder, which USES filedelete (), also can only be run at 08:30 just ok, I want to have any method, is executed automatically when 08:30, don't be performed manually can delete the data?

CodePudding user response:

refer to the second floor jinxiaorong1 response:
written procedures should be only in the time of execution, such as I need to delete in 08:30 AA data folder, which USES filedelete (), also can only be run at 08:30 just ok, I want to have any method, is executed automatically when 08:30, don't be performed manually can delete the data?


1. The MSSQL background JOB processing
2. The timer () to do regular processing!

CodePudding user response:

reference 1st floor xuam response:
job

What is the job?

CodePudding user response:

reference 4 floor jinxiaorong1 response:
reference 1st floor xuam response:
Job

What is the job?


Job - work is performed by the SQL Server agent in order to a series of the specified operation, homework can perform a wider range of activities, including running Transact - SQL script, a command-line application and Microsoft? ActiveX? Script, often can create a job to execute repeat and schedulable task, and the job can produce alarm to notify the user operation state,

Specific check SQL online help!

CodePudding user response:

Can directly use pb program for
A, through the timer to control the execution time;
Second, through the listbox dirlist function to get all the files in the directory specified;
Three, delete the files listed listbox filedelete way cycle;

CodePudding user response:

Call the deletion of the DOS command, write a bat file, added to the project task, further, can also use the program constructs the bat file, flexibility is also big

CodePudding user response:

Pb timer event in the written judgment string (now (), 'HHMM')='0830' and then execute filedelete (), suggest using the date of a file record delete l_date, writing the string in the timer events (now (), 'HHMM) & gt; And l_date='0830' & lt;> Today, so that to prevent 08:30 not deleted, for the moment, you can also delete again,

CodePudding user response:

Ddlb_1. DirList (is_path, 1)
Li_rc=ddlb_1. Totalitems ()
If li_rc & lt; 1 then
Return
End the if

For ll_rc=1 to ddlb_1. Totalitems ()

L_filename=ddlb_1. Text (ll_rc)
Filedelete (l_filename)

CodePudding user response:

Use Windows timer task, so a little bit more simple,
  • Related