Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Visual Basic (VB 4/5/6) » General Visual Basic » Copy Paste Files


Copy Paste FilesExpand / Collapse
Author
Message
Posted 3/22/2008 8:38:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/22/2008 8:35:21 AM
Posts: 2, Visits: 2
i want to copy a file from fixed location like

d:\my project\abc.txt (it reamins always fixed)

to the folder user select like

e:\backup\abc.txt

now what is the code to copy and what is the code to paste files

if any body know some sample project as just there are many sample

availeable in this site please tell me

thanks

Post #24439
Posted 3/22/2008 6:31:07 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: Today @ 8:00:49 AM
Posts: 1,376, Visits: 3,098
Welcome to A1vbcode muddasirmunir

You don't actually copy using the ClipBoard.

To copy a file you can use FileCopy or CopyFile functions.

'CopyFile source, destination[, overwrite]

CopyFile d:\my project\abc.txt, e:\backup\abc.txt, True

'or

'FileCopy source, destination

FileCopy d:\my project\abc.txt, e:\backup\abc.txt

With the CopyFile you can set if you want to overwrite the file.

Keith

http://www.martin2k.co.uk/forums/

I've been programming with VB for 12 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Post #24441
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Brian, Peter

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 7:36pm