VBS - Access denied txt doc

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

VBS - Access denied txt doc

Post by MigrationUser »

22 Sep 2010 10:52
scott_humphris


Please can someone help me with editing an access denied text document?

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")
But this will not work for access denied document.

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

#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.

original thread: https://ss64.org/oldforum/viewtopic.php?id=1099
Post Reply