Results 1 to 4 of 4

Thread: Renaming Files

  1. #1

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Exclamation

    I have a file mark.mdb in a known location. i want to rename this file to test.mdb in the same location.

    Any ideas?

    I am using VB5 SP3

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    You could use the FileSystemObject and make this really easy.

    Code:
    Dim fso
    Dim AppPath as string
    
    Set fso=CreateObject("scripting.filesystemObject")
    
    AppPath="c:\windows\desktop\database\db11\"
    
    
    fso.CopyFile AppPath & "sourcebook.mdb",AppPath & "testbook.mdb"
    Hope this helps.

  3. #3
    Guest
    Here is another method. It copies the file with a new name, then delete's the old one.

    Code:
    SourceFile = "C:\Windows\Desktop\tttt.txt"
    DestFile = "C:\Windows\Desktop\MyNewFileName.txt"
    
    FileCopy SourceFile, DestFile
    
    Kill SourceFile

  4. #4

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Wink Thanks

    Thanks,

    All is well in the land of file renaming


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