Solved

FileSystemObject, with VB 6 and Windows XP

Posted on 2002-03-20
5
206 Views
Last Modified: 2010-05-02
I've been trying to use the Scripting.FileSystemObject in VB 6 on my Windows XP Pro machine.

The object doesn't seem to exists, from what the error messages are returning:

"User-defined type not defined"

Has the scripting code changed between win2000 and XP?

Has anyone been able access folders and file information with VB 6 on XP?

Note: Unsure, but, do I have to install windows scripting on XP?
0
Comment
Question by:Timelib
  • 2
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 50 total points
ID: 6884713
Hi Timelib,

Seems like the scrrun.dll isn't recognized, you could try late binding if you use early binding. You recompiled the code on the XP machine?

Also a note on fso in VB, it was intended for scripting languages like VBScript. VB has his own file I/O capabilities you'd need. When all else fails there are always a few API functions to use.

:O)Bruintje
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6885014
You're right that Windows Scripting is needed to run FSO. Not sure though w.r.t. XP. Otherwise, as suggested already by bruintje, you can use other methods, so that you dont need to reference to one more DLL in your project.

Still if you wish to use FSO, just check scrrun.dll is there in your system and also registered: i.e.
Start/Run - RegSvr32.exe scrrun.dll

Hope it helps.
0
 
LVL 1

Author Comment

by:Timelib
ID: 6886849
scrrun.dll is in XP Pro, and registered but its not except it as defined.

What API functions can be called, and were can I get examples or more information on them?
0
 
LVL 1

Author Comment

by:Timelib
ID: 6886896
I've wrote with the FSO before, I just forgot one minor step......binding (referencing) the scrrun.dll first.....

And I call my self a programmer....

Thanks for the help.
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6887817
We had faced problems with FSO, say, if a system does not have Windows Scripting Host(hope, this could happen, if Internet Explorer installed in Win95 is default one, and not like IE4 or IE5). Then your program wont run, causing error.

So, recommend not using FSO, otherwise include it(scrrun.dll) in your project installation and register in installation PC.

Hope it helps.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

757 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

20 Experts available now in Live!

Get 1:1 Help Now