set fso=server.createobject("scripting.filesystemobject")

'create file
'the second param will over-write if file already exists
set
a=fso.createtextfile("c:\somefolder\someotherfolder\here\newtextfile.txt",tr
ue)
a.write "content"
a.close
set a=nothing

'list content of folder
set folder=fso.getfolder("c:\somefolder\someotherfolder\here")
set files = folder.files

for each file in files
    response.write file.name & "<BR>"
next

set file=nothing
set folder=nothing
set fso=nothing

HTH
----- Original Message -----
From: "Chris Janz" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Monday, September 30, 2002 4:16 PM
Subject: Scripting.FileSystemObject question


> question,
>
> how do i use Scripting.FileSystemObject to create a file that doesn't
> already exist?
>
> also, does anyone know of an easy way to list the contents of a folder
using
> the FileSystemObject?  (quick and dirty works fine - it doesn't need to be
> recursive or special in any way - let's say i need to list the .txt files
of
> c:\somefolder\someotherfolder\here\
>
> thanks,
> chris
>
>
> ---
> You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%


---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to