Solved

moving and copying files

Posted on 1998-10-29
2
156 Views
Last Modified: 2010-05-18
I am writing a short little program to move/copy files from one workstation to another and I have several questions that I have to get answered. The first is:
1. How do I get just the path from a common dialog open? I like the way it looks and the fact that you do not have to map a network drive beforehand.
2. How do I scan for files? I would like to be able to move/copy all files that match a certain criteria (say *.log or *.doc) and then write to a log that I moved/copied so an so.
3. How do I scan all sub directories(for question 2)
4. How do I tell if a file is in use/open?
Any help would be appreciated.
If you need more info, contact me at cliffm@tidalwave.net
0
Comment
Question by:cliff_m
[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
2 Comments
 
LVL 2

Accepted Solution

by:
shchuka earned 100 total points
ID: 1442350
1. you cannot use the file open dialog box to get the directory name alone - you need a file to be selected in it, then you can actually get the directory from that file.  If your problem is in mapping network drives from your program, I can send you some pieces of code that do that.

2. use function Dir of VB look for it in the help - it does what you want.

3. Again, use Dir function. You will need to write a recursive function which would scan for the directories, since you need to traverse all subdirectories.

4. There are several methods.  One is to try to open the file for reading - and trap errors.  One of the possible errors is 'permission denied'.

These should get you started,
-Aleks.
0
 

Author Comment

by:cliff_m
ID: 1442351
Can you give me some code sample for mapping network drive for problem 1? the rest of it looks like it will work.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
Suggested Courses
Course of the Month4 days, 18 hours left to enroll

636 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