Solved

Simple Copy command

Posted on 2000-05-11
6
174 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
Technology Partners: 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

Technology Partners: 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!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

749 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