Microsoft Windows
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Been thanked: 2 times
Contact:

22 Sep 2010 10:52
scott_humphris

Normaly i use this to add a line to text docs:

Code: Select all

``````fname=Inputbox("Please enter the text you would like added")
Set ObjFso = Wscript.CreateObject("Scripting.FileSystemObject")
Set ObjFileHandle = _
ObjFso.OpenTextFile("C:\test.txt", 8, "True")
``````

----------------------------

#2 22 Sep 2010 16:30
bluesxman

Access denied is the usual response if a file is locked for writing by another process or the ACLs are not permitting write access to the user running the script. In these scenarios this is the operating system working correctly, so I wouldn't hold your breath. If it's permissions, perhaps moving the file elsewhere (C:\ is a likely candidate for security lock down) will yield positive results.