Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateTextFile and wrong creation date

Status
Not open for further replies.

huggyd

Programmer
Nov 26, 2001
58
GB
Background:
I am using vbscript to create a text file at the end of SQLServer 2000 DTS package. This file will act as an event trigger for Crystal Enterprise reports.

Problem:
First run of package creates text file that has matching created and modified dates.

Subsequent runs have new modified date but same creation date... even though the file is deleted and then created.

For my event trigger file name must stay the same but creation date must be more recent than last run.

Sample Code:
Code:
If objFSO.FileExists("c:\Finished.txt") then
    objfso.DeleteFile "c:\Finished.txt"		
End if
set f = objfso.CreateTextFile("c:\Finished.txt",false)
f.write "Process completed"
f.close
Any ideas please!!
 
Are you sure the script is deleting the file? Try just running it up to the deletion statement and see if it is getting deleted.

Is the file is read only, you will need to add the folowing to your code:
If objFSO.FileExists("c:\Finished.txt") then
objfso.DeleteFile "c:\Finished.txt", True
End if

Hope this helps.

Dana Hallenbeck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top