FileSystemObject 的驱动器盘符用法 - VBScript
我正在从 Win 2003 服务器迁移到 Win 2008 R2 服务器。我正在运行一个经典的 ASP 应用程序。在 2003 服务器中,以下代码用于创建文件:
CONST SCRATCH_DIR = "E:\Temp\"
设置 FSO = CreateObject("Scripting.FileSystemObject")
Set TFL = FSO.CreateTextFile(SCRATCH_DIR & "Debug.txt", True)
在新服务器上,Set TFL 行给出以下错误:
Microsoft VBScript 运行时错误“800a0046”
权限被拒绝
/inc/vbutil.inc,第 110 行
如果我从 CONST 中删除驱动器名称“E:\”,该过程就可以正常工作; (除了它写入 C:\ 驱动器)所以我确信错误消息是正确的。
谁能指出我在哪里/如何更改此 (E:\Temp) 目录的权限?
预先非常感谢,
(一个愚蠢的应用程序程序员;)
I am migrating from a Win 2003 server to a Win 2008 R2 server. I'm running a classic ASP application. In the 2003 server the following code worked for creating a file:
CONST SCRATCH_DIR = "E:\Temp\"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TFL = FSO.CreateTextFile(SCRATCH_DIR & "Debug.txt", True)
On the NEW server the Set TFL line gives me this error:
Microsoft VBScript runtime error '800a0046'
Permission denied
/inc/vbutil.inc, line 110
If I remove the Drive designation "E:\" from the CONST, the procedure works just fine; (except it writes to the C:\ drive) so I'm sure the error message is correct.
Could anyone please point me at where/how I'd change permissions for this (E:\Temp) directory?
Thanks very much in advance,
(A dumb application programmer;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过右键单击文件夹>来更改文件夹的权限属性>安全>高级。
取消选中“包括来自该对象父对象的可继承权限”。
点击“添加”
修改运行脚本的用户的权限。他们将需要读取、写入和创建权限。
You can change permissions on the folder by right clicking it > Properties > Security > Advanced.
Uncheck "Include inheritable permissions from this object's parent".
Click "Add"
Modify permissions for the user running the script. They will need read, write and create permissions.