Results 1 to 2 of 2

Thread: [RESOLVED] Copy a file to a predetermined location

  1. #1

    Thread Starter
    Member Shadow45o's Avatar
    Join Date
    Sep 2008
    Posts
    51

    Resolved [RESOLVED] Copy a file to a predetermined location

    What I am trying to figure out is a way to copy a file and paste it in another location. So that there will be the original file in the user set location, and then a duplicate of that file in, say, the "Program Files" folder. I would also need some way to check if the file exists to, so that it doesn't keep creating a new file each time the program starts up.

    to sum it up: I need to be able to copy a file to a predetermined location and check if the file exists, and if it doesn't, it will copy the file over to the location.

    Thanks in advanced

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: Copy a file to a predetermined location

    try this:

    vb Code:
    1. If Not IO.File.Exists(destFilename) Then
    2.     IO.File.Copy(sourceFileName, destFilename)
    3. End If

Tags for this Thread

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