Solved

Simple Copy command

Posted on 2000-05-11
6
170 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
6 Comments
 

Expert Comment

by:scibberme
Comment Utility
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
Comment Utility
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
Comment Utility
Use the FileSystemObject (add a reference to Microsoft Scripting Runtime) and use

Dim X as new FileSystemObject

X.CopyFile "c:\*.*", "\\target\folder\"
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 3

Expert Comment

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

Author Comment

by:MKrauss
Comment Utility
Works fine => Thanks
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
not a problem paul...thanks for the B mk
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now