Solved

moving and copying files

Posted on 1998-10-29
2
147 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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now