|
-
Nov 28th, 2001, 07:15 AM
#1
Thread Starter
Evil Genius
I'm want to find a file/files in a known directory that were created on today's date...
Take a look at the GetFileTime API call (www.vbapi.com or www.allapi.net).
and change their extension so another program doesn't pick them up...
That'd be the Name command :
Code:
Name C:\File.exe as C:\file.bmp
-
Nov 28th, 2001, 09:03 AM
#2
New Member
Thanks for that, but can you use the 'name as' command with wildcards?
If not, is it possible to rename "c:\monday*.log" to "c:\monday*.old"
Cheers
-
Nov 28th, 2001, 09:43 AM
#3
Thread Starter
Evil Genius
Um...no It doesn't support wildcards * or ?
You could perform a loop though...
Code:
Private Sub Command1_Click()
Dim intcounter As Integer
If File1.ListCount < 1 Then Exit Sub
With File1
For intcounter = 0 To (.ListCount - 1)
.Selected(intcounter) = True
If Left(LCase(.FileName), 6) = "monday" Then
Name (.Path & "\" & .FileName) As _
(.Path & "\" & Left(File1.FileName, Len(.FileName) - 4) & ".old")
End If
Next intcounter
End With
End Sub
This one uses a filelistbox and a command button.
Note that on the form load I set the file1.path to point to a specific folder, and that I don't update the filelistbox when this procedure's finished.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|