FileSystem Object 
Author Message
 FileSystem Object

I'm relatively new to VB but have written several other languages.  I'm
trying to build a simple client side app that just retrieves specific files
from different machines in the workgroup, renames them, zips everything up,
and notifies the user of success or failure.  I'm fairly certain that
FileSystem Object can do all of those things with its methods, however I
have not seen a method or example of how to rename a file, or how to
retrieve files from other machines on the network.  Any help would be
appreciated.  Thanks.

Steve



Sat, 15 May 2004 13:14:50 GMT  
 FileSystem Object
Name Property
Sets or returns the name of a specified file or folder. Read/write.

object.Name [= newname]

Arguments
object

Required. Always the name of a File or Folder object.

newname

Optional. If provided, newname is the new name of the specified object.

Remarks
The following code illustrates the use of the Name property:

Function ShowFileAccessInfo(filespec)
   Dim fso, f, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(filespec)
   s = f.Name & " on Drive " & UCase(f.Drive) & "<BR>"
   s = s & "Created: " & f.DateCreated & "<BR>"
   s = s & "Last Accessed: " & f.DateLastAccessed & "<BR>"
   s = s & "Last Modified: " & f.DateLastModified
   ShowFileAccessInfo = s
End Function
-----------------------
Also to retrieve a file, you can use the GetFile method, just give it a path
whether
its UNC or a direct path like C:\Winnt\File.exe. From there you can use the
Move, Copy and
other methods that are available.
Good luck..


Quote:
> I'm relatively new to VB but have written several other languages.  I'm
> trying to build a simple client side app that just retrieves specific
files
> from different machines in the workgroup, renames them, zips everything
up,
> and notifies the user of success or failure.  I'm fairly certain that
> FileSystem Object can do all of those things with its methods, however I
> have not seen a method or example of how to rename a file, or how to
> retrieve files from other machines on the network.  Any help would be
> appreciated.  Thanks.

> Steve



Sat, 15 May 2004 19:50:54 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. filesystem object

2. filesystem object and UNC?

3. performance of FileSystem-object

4. FSO (FileSystem object)

5. FileSystem Object Read Order

6. Problem with filesystem object

7. GetFolder method for FileSystem Object not working on Win2000

8. FileSystem Object Network Path Error

9. Reading the Binary file using FileSystem Object

10. FileSystem Object

11. filesystem object problems (again)

12. filesystem object problems

 

 
Powered by phpBB® Forum Software