Results 1 to 2 of 2

Thread: How to copy, paste and rename a file without opening it

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474

    How to copy, paste and rename a file without opening it

    In my application i need to search for a file in a special folder, make a copy of it, save it to a desired location and then rename it, (or first rename it and then save it) without opening the file. How can i accomplish that?

    Thanks

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    This should work I guess...

    Code:
    Dim f As New System.IO.FileInfo("D:\winter.jpg")
    f.CopyTo("D:\Test\winter2.jpg")
    You have to create the new folder (Test in this example) if it doesn't exist or else you will get an error.

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