Solved

Simple Copy command

Posted on 2000-05-11
6
172 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
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add a task in Outlook from access 11 39
Looking for VB6 code to read SQL table export it to ascii 8 38
Recommendation vb6 to vb.net or others 14 149
Help me. 3 55
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

777 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