masj78
05-04-2006, 01:33 PM
Hi there,
I am having real problems with file permissions with the FileSystemObject in VBScript and need some advice.
This is the code I am using:
Dim Data
Data = "c:\Data.css"
Set FileToWrite = Server.CreateObject("Scripting.FileSystemObject")
If FileToWrite.FileExists(Data) Then
FileToWrite.DeleteFile Data, True
Set StyleWrite = FileToWrite.CreateTextFile(Data)
Else
Set FileToWrite = FileToWrite.CreateTextFile(Data)**
End If
At present the file Data.css exists. If it doesn't exist I want to create a new one and if not I want to delete the file and recreate it. I have set all permissions I can think of for the Internet and Web guest accounts on the C drive, but it will not allow it to be deleted and gives a permissions denied error.
If the code to delete the file is commented out and you allow the file to be overwritten instead by changing the creation file code to:
Set FileToWrite = FileToWrite.CreateTextFile(Data, True)
This gives the same permission denied error :mad:
The asp page I am running with this code is running off my localhost and is being debugged in VS.NET.
Any suggestions on what might be wrong and what settings to re-check.
I am having real problems with file permissions with the FileSystemObject in VBScript and need some advice.
This is the code I am using:
Dim Data
Data = "c:\Data.css"
Set FileToWrite = Server.CreateObject("Scripting.FileSystemObject")
If FileToWrite.FileExists(Data) Then
FileToWrite.DeleteFile Data, True
Set StyleWrite = FileToWrite.CreateTextFile(Data)
Else
Set FileToWrite = FileToWrite.CreateTextFile(Data)**
End If
At present the file Data.css exists. If it doesn't exist I want to create a new one and if not I want to delete the file and recreate it. I have set all permissions I can think of for the Internet and Web guest accounts on the C drive, but it will not allow it to be deleted and gives a permissions denied error.
If the code to delete the file is commented out and you allow the file to be overwritten instead by changing the creation file code to:
Set FileToWrite = FileToWrite.CreateTextFile(Data, True)
This gives the same permission denied error :mad:
The asp page I am running with this code is running off my localhost and is being debugged in VS.NET.
Any suggestions on what might be wrong and what settings to re-check.