General discussion

Locked

VB: determining the size of a directory

By dwtk9 ·
Hi ,
2 Questions

My name is Derek . I've just wrote a program to copy files from a local directory to a network drive.

Question 1: I need to know how I can use VB5 to determine the size of the local directory before sending copying the files over to the network drive.
The purpose of doing so is to ensure that users do not copy to big files to the network drive via this program I wrote. I tend to keep the space limit about 600 MB per local dir.

Question 2: How do I schedule the vb program to run every Friday at 2pm.

Please let me know soon

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB: determining the size of a directory

by yuri In reply to VB: determining the size ...

1. You can use the FileSystemObject and Folder objects. A Folder object has a Files property which is a collection of File objects. Iterate over it using For Each, summing the file sizes and calling the folder size function recursively for subfolders.

2. Use any available task scheduler. Microsoft Plus! for Windows 95 includes one called System Agent. Internet Explorer 4.0 and higher contains the Task Scheduler, a successor to System Agent.

Collapse -

VB: determining the size of a directory

by dwtk9 In reply to VB: determining the size ...
Collapse -

VB: determining the size of a directory

by krokodil In reply to VB: determining the size ...

Q2 (sheduling): Insert Timer object in your program, set Interval to 750. In the Timer Sub write code that will check the day in weak ad time like this:
sheduleday=6
'Sunday=1;Monday=2;Tuesday=3 ...
shedulehour= "14:00:00"
daycheck= WeekDay(Date)
hourcheck= Time
If daycheck=sheduleday and hourcheck=shedulehour then ...

You must insert some code to disable that this routine runs 2 times at each shedule

Collapse -

VB: determining the size of a directory

by dwtk9 In reply to VB: determining the size ...
Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums