473,544 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileSystemObjec t

Hello

I am using the FileSystemObjec t to copy files on a computer

Dim MyObject as Object

Set MyObject = CreateObject("S cripting.FileSy stemObject")

MyObject .CopyFile "C:\My Documents\Test. txt", "C:\New Folder\Test.txt "



It seems to work OK; the file is being copied but when I write the

code it doesn't behave as if there is any References involved.

Ex: when I write MyObject . usually there is a dropdown window with
available

options that appears; this is not happening.

Also when I write copyfile it should automatically Ucase the c and f
(CopyFile) and

it doesn't do this either.

Is this normal for FileSystemObjec t?

Is there a better way to delete and copy files and folders?

Does anyone know what Reference FileSystemObjec t uses?

Last: I read at the following link :
http://support.microsoft.com/kb/q197953/

that bloating will occur when Data Access Objects (DAO) is used to create
objects

in a database; is it the same with the code I am using?

Dim MyObject as Object

Set MyObject = CreateObject("S cripting.FileSy stemObject")

Thanks

G Gerard
Nov 4 '06 #1
1 17085
"G Gerard" <gg*****@nbnet. nb.cawrote in message
<Jm************ *******@ursa-nb00s0.nbnet.nb .ca>:
Hello

I am using the FileSystemObjec t to copy files on a computer

Dim MyObject as Object

Set MyObject = CreateObject("S cripting.FileSy stemObject")

MyObject .CopyFile "C:\My Documents\Test. txt", "C:\New
Folder\Test.txt "



It seems to work OK; the file is being copied but when I write the

code it doesn't behave as if there is any References involved.

Ex: when I write MyObject . usually there is a dropdown window with
available

options that appears; this is not happening.

Also when I write copyfile it should automatically Ucase the c and f
(CopyFile) and

it doesn't do this either.

Is this normal for FileSystemObjec t?

Is there a better way to delete and copy files and folders?

Does anyone know what Reference FileSystemObjec t uses?

Last: I read at the following link :
http://support.microsoft.com/kb/q197953/

that bloating will occur when Data Access Objects (DAO) is used to
create objects

in a database; is it the same with the code I am using?

Dim MyObject as Object

Set MyObject = CreateObject("S cripting.FileSy stemObject")

Thanks

G Gerard
You are using late binding, so no references are involved.

You can switch to early binding by referencing Microsoft Scripting
Runtime, then declare and instantiate like this

Dim MyObject as Scripting.FileS ystemObject
Set MyObject = New Scripting.FileS ystemObject

In these NGs you will often be recommended to use FileCopy in stead,
as it doesn't need any references (member of VBA.FileSystem) . Check
it out in the help files.

--
Roy-Vidar
Nov 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3836
by: Marcelo Rizzo | last post by:
I am trying to get the name of a file with a specific extension (tmw) from several different directories. The problem I am having is that the program stops working on the second pass with an run time error 76. The paths are valid. I tested them and there is a file with the extension specified. Any help is appreciated Marcelo Rizzo
5
4044
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: =================================
3
2104
by: Steve | last post by:
Hi all, FileSystemObject question... I'm trying to check if files exist or not, but the files are not sitting on the same server as our Intranet. Basically we have about 5000 photos in a directory on our database server, and they must stay there. I want to use the FileSystemObject (running on our Intranet server) to check if a photo is...
2
1545
by: Jason | last post by:
Hello, I'm posting here in the hopes that someone can give me a detailed synopsis of the ActiveX object, FileSystemObject, or even provide some good links about it. These are the questions that I am mainly concerned about: 1) Has the FileSystemObject changed a lot over the last few Windows versions and JavaScript versions? I need to...
2
2166
by: Sean S - Perth, WA | last post by:
Hi all, If I create a FileSystemObject Object is it appropriate to reuse it to perform operations on different files/folders? Or should I create a new FileSystemObject Object for each file and folder? -- Sean.
9
3891
by: kermit | last post by:
I keep seeing that you can use the FileSystemObject in either VB script, or Javascript on an aspx page. I added a refrence to the scrrun.dll I added importing namespaces for 'System.Object', 'Scripting', 'Scripting.FileSystemObject', and a few others However, when I try to create the fso object I keep receiving an error. 'ActiveX...
2
4018
by: Luis Esteban Valencia | last post by:
I'm trying to write a little VB.NET script in an ASP.NET web page that will create folders, move files, etc... pretty much everything you can expect to do using the FileSystemObject library. Is this possible in .NET? If so, how do I do it? I've tried:
3
1849
by: nagmvs | last post by:
hello I have a problem with FileSystemObject in Vb Suppose i want to declare as Dim fs As New FileSystemObject, when i type New After that i can't see FileSystemObject in derived DropDownList. When running my code compiler error coming is like User defined type not defined. before projects r running successfully with using...
12
5878
lee123
by: lee123 | last post by:
why is this so hard to do. i have alot of books that have exaples of how to do these things but when i try the exaples they never work i have a previous post on "copying files" some of the other guys help on this one and i tried to do the same thing with the "movefile" but it never worked as you can see the "filesystemobject" is hard to accomplish...
0
7437
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7625
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7389
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7717
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5928
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5306
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4930
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1848
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.