?
Solved

Simple Copy command

Posted on 2000-05-11
6
Medium Priority
?
176 Views
Last Modified: 2010-05-02
how can I simply copy *.* files through VB
best would be to UNC targed
0
Comment
Question by:MKrauss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Expert Comment

by:scibberme
ID: 2800871
You could use vb to make a batch file. Then use "shell" to run it. This would let you use any DOS commands.
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 150 total points
ID: 2800898
you can use the filesystemobject..for example:

Dim filesys As Object

Set filesys = CreateObject("Scripting.FileSystemObject")

filesys.CopyFile "c:\mydocuments\letters\*.doc", "c:\tempfolder\"


0
 
LVL 3

Expert Comment

by:paulstamp
ID: 2800904
Use the FileSystemObject (add a reference to Microsoft Scripting Runtime) and use

Dim X as new FileSystemObject

X.CopyFile "c:\*.*", "\\target\folder\"
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:paulstamp
ID: 2800939
Sorry Azrasound - your comment came up as I was posting !
0
 
LVL 1

Author Comment

by:MKrauss
ID: 2800941
Works fine => Thanks
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2800944
not a problem paul...thanks for the B mk
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question