Results 1 to 2 of 2

Thread: Move files...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    103

    Unhappy Move files...

    Hi All...

    In order to make my job easier, i want to move all the files in one folder, disregarding the file extension, but only those who's name are numeric.
    I'm having trouble because i don't know hwo to select then without the extension..
    Can someone help me please... thank's a lot

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Like:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     Dim strBuff As String
    5.  
    6.     'Set the first FileName (if pressent)
    7.     strBuff = Dir("C:\temp\*.*", vbNormal)
    8.  
    9.     'If a FileName exisits - perform the copy if Numeric, and continue till all files copied
    10.     If Len(strBuff) <> 0 Then
    11.         Do
    12.             If IsNumeric(Left$(strBuff, InStr(strBuff, ".") - 1)) Then
    13.                 FileCopy "C:\temp\" & strBuff, "C:\temp\New Folder\" & strBuff
    14.             End If
    15.  
    16.             strBuff = Dir
    17.  
    18.         Loop Until Len(strBuff) = 0
    19.     End If
    20.  
    21. End Sub




    Bruce.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width