Results 1 to 6 of 6

Thread: Copying files from A: to C:

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    11
    Can anyone tell me the code to copy files from drive A: to drive C: on the click of a button. (VB V.5)

    Thanks a lot.

    P.S. Finding it difficult to get FileCopy to work!

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Make sure you leave out the paranthesis
    Code:
    FileCopy "A:\whatever.txt, "C:\Test\whatever.txt"
    Last edited by Lethal; Mar 11th, 2001 at 03:37 PM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    11

    Not Working!

    Just pasted code in and altered file names, got the following error message :

    "Expected list seperator or )" - The cursor appeared avoer the C:

    Any info to fix this?

    Thanks

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Yeah, dont use the paranthesis. Just:
    Code:
    FileCopy "C:\Test.txt", "C:\Testing\Test.txt"

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    11

    Now I am getting another error ...

    I left the parenthesis out, altered the filenames but this time the error message is :

    "Invalid Outside Procedure" - This appears over my filename which is "A:\Folder1\Item1.XLS"

    How can I fix this error

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    this isn't just free floating code, right? you need to have it inside a Sub or Function...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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