Solved

moving and copying files

Posted on 1998-10-29
2
152 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
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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

685 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