Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The forum looks great! You guys have done a fantastic job on arranging things there...Your site is very precise and fun to visit..."

Geography

Where in the world do Tek-Tips members come from?
tonyj (TechnicalUser)
7 Nov 00 15:11
How can i through code in Access move full directories. the FileCopy command does not work with wildcards.
THoey (IS/IT--Management)
7 Nov 00 15:34
I am not sure, but I thought you could execute shell commands.   If you can, then maybe that is a way to go.

I'll try to hunt around in the help.


Terry M. Hoey
th3856@txmail.sbc.com
 
Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
THoey (IS/IT--Management)
7 Nov 00 15:39
The following is the help for the Shell command:

Runs an executable program and returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero.

Syntax

Shell(pathname[,windowstyle])

The Shell function syntax has these named arguments:

Part    Description
pathname    Required; Variant (String). Name of the program to execute and any required arguments or command-line switches; may include directory or folder and drive.
windowstyle    Optional. Variant (Integer) corresponding to the style of the window in which the program is to be run. If windowstyle is omitted, the program is started minimized with focus.
The windowstyle named argument has these values:

Constant    Value    Description
  
vbHide    0    Window is hidden and focus is passed to the hidden window.
vbNormalFocus    1    Window has focus and is restored to its original size and position.
vbMinimizedFocus    2    Window is displayed as an icon with focus.
vbMaximizedFocus    3    Window is maximized with focus.
vbNormalNoFocus    4    Window is restored to its most recent size and position. The currently active window remains active.
vbMinimizedNoFocus    6    Window is displayed as an icon. The currently active window remains active.
Remarks

If the Shell function successfully executes the named file, it returns the task ID of the started program. The task ID is a unique number that identifies the running program. If the Shell function can't start the named program, an error occurs. If you use the MacID function with Shell in Microsoft Windows, an error occurs.

Note   The Shell function runs other programs asynchronously. This means that a program started with Shell might not finish executing before the statements following the Shell function are executed.

I am not sure if that will help or not, but it may be worth a try.   

Hope it helps...

Terry M. Hoey
th3856@txmail.sbc.com
 
Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
Durkin (Programmer)
7 Nov 00 22:53
Look up the FileSystemObject. It has a bunch of methods for doing jobs with the file system one of which includes copying a folder. Strangely enough this method is called 'copyfolder'.

Durkin
alandurkin@bigpond.com

THoey (IS/IT--Management)
8 Nov 00 8:54
Durkin,

I looked through the help files and the book that I have and I can't find anything on FileSystemObject.   Is there any chance you can paste some info on it here?

Thanks...


Terry M. Hoey
th3856@txmail.sbc.com
 
Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
Durkin (Programmer)
8 Nov 00 16:40
This is the page from the Access help:

Description

Provides access to a computer's file system.

Syntax

Scripting.FileSystemObject

Remarks

The following code illustrates how the FileSystemObject is used to return a TextStream object that can be read from or written to:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
a.WriteLine("This is a test.")
a.Close

In the code shown above, the CreateObject function returns the FileSystemObject (fs). The CreateTextFile method then creates the file as a TextStream object (a), and the WriteLine method writes a line of text to the created text file. The Close method flushes the buffer and closes the file.

 


The URL for the page at msdn is
http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbenlr98/vaobjfilesystemobject.htm

Durkin
alandurkin@bigpond.com

THoey (IS/IT--Management)
8 Nov 00 16:44
I see from that path that this is a Visual Studio 6 function.   Is it in Access, too?   I'll try to find it.   

But, thanks for the info.


Terry M. Hoey
th3856@txmail.sbc.com
 
Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
Durkin (Programmer)
8 Nov 00 18:13
The page I pasted into my previous message is straight from the help in Access 2000. If you are using Access 97 it's possible that it's not in there. Anyway, you can definitely use it in Access - I have done it before.

Durkin
alandurkin@bigpond.com

tonyj (TechnicalUser)
8 Nov 00 18:19
thanks everyone for the help. i found that by using the shell command and comspec i could make this work. her is the code if anyone else is interested. keep in mind the source directory and destination directory are for my program and will not apply to yours.

Shell (Environ$("COMSPEC") & " /c move \\Nustyle\Files\" & vstatus & "\" & vProjectName & " " & "\\Nustyle\Files\Completed\" & vProjectName)
MichaelRed (Programmer)
9 Nov 00 7:03
tonyj,

Be aware that this - and most/all Windows based approaches will not copy 'open' files.  You need to be careful using this approach, as the function may not complete the move if there are open files in the source directory.



MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close