OK, let's see if I can remember how to do this...
Dim fso 'As Scripting.FileSystemObject
Dim stream 'As Scripting.TextStream
Set fso = CreateObject("Scripting.FileSystemObject")
'Check that the secon folder exists
If fso.FolderExists("C:\Documents and Settings\All Users\Application Data\secon") Then
Else
fso.CreateFolder("C:\Documents and Settings\All Users\Application Data\secon")
End If
'Check that the smartapp folder exists
If fso.FolderExists("C:\Documents and Settings\All Users\Application Data\secon\smartapp") Then
Else
fso.CreateFolder("C:\Documents and Settings\All Users\Application Data\secon\smartapp")
End If
'Create the file as ASCII text, overwrite it if it already exists
Set stream = fso.CreateTextFile("C:\Documents and Settings\All Users\Application Data\secon\smartapp\listitem.txt", true, false)
'Close it neatly
stream.Close
'Clean up
Set stream = Nothing
Set fso = Nothing