Solved

Simple Copy command

Posted on 2000-05-11
6
175 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 50 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

696 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