473,383 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do I Use FileSystemObject?

TC
I'm trying to write some simple code using FSO, but I can't make it
work. There are a many FSO tutorials on the web, but they all start
with a line similar to:

set fs=Server.CreateObject("Scripting.FileSystemObject ")

Yet that line simply doesn't work. I've tried it on my server and on
my development PC, both of which are configured as web servers running
ASP. I suspect that these computers simply aren't configured to
support FSO, but nowhere can I find any hint of how to do that
configuration. Can anyone help?

-TC
Feb 4 '08 #1
1 1588
"TC" <go*********@yahoo.comwrote in message
news:4f**********************************@i72g2000 hsd.googlegroups.com...
I'm trying to write some simple code using FSO, but I can't make it
work. There are a many FSO tutorials on the web, but they all start
with a line similar to:

set fs=Server.CreateObject("Scripting.FileSystemObject ")

Yet that line simply doesn't work. I've tried it on my server and on
my development PC, both of which are configured as web servers running
ASP. I suspect that these computers simply aren't configured to
support FSO, but nowhere can I find any hint of how to do that
configuration. Can anyone help?
Try this:

<% @Language="VBScript" %>
<% Option Explicit
Const cASP = "MapPath.asp"
Dim strSMP
strSMP = Server.MapPath(cASP)
Response.Write "<li>" & strSMP
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Response.Write "<li>" & objFSO.GetFile(strSMP).DateCreated
Set objFSO = Nothing
%>

Call it via (or something like): http://localhost/MapPath.asp

Here's the output I got:

* C:\Inetpub\wwwroot\MapPath.asp
* 02/03/2008 10:44:19 PM

What do you get?
Feb 4 '08 #2

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

Similar topics

0
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...
5
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
by: Wayfarer | last post by:
Hi, I've got a freebie hosting mirror of my production personal website (sounds kinda grandiose, doesn't it?) at http://journeys.webhostme.com/. At the production website I was using...
3
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...
2
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...
9
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',...
2
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...
1
by: G Gerard | last post by:
Hello I am using the FileSystemObject to copy files on a computer Dim MyObject as Object
3
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. ...
12
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.