开发者

Permission denied on creating a folder under wwwroot/vhosts/sitename/test using VBScript

I am trying to make my ASP page to create a folder on a directory path. I am getting an error:

Microsoft VBScript runtime error '800a0046'

Permission denied

I know its something to do with IIS 7 IUSR permission for the folder.

The code is below.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<body>
<%
 dim strUserName
 foldername= "myfolder"
 dim fObject,f
 set fObj开发者_如何学编程ect=Server.CreateObject("Scripting.FileSystemObject")
 response.write(server.mappath("\")&"\test\"&foldername)
 set f=fObject.CreateFolder(server.mappath("\")&"\Letters\"&foldername) 
 set f=nothing
 set fObject=nothing
 response.write("folder created successfully<br/>")

%>
</body>
</html>


Got it fixed, I had to add IUSR user and IIS_IUSRS group (for IIS 7 only) as my Security settings to my virtual directory folder that propagates to the sub folders.

If additional permission is required for specific sub folders, then add additional permission by right clicking the folder name, and select Properties. Click on Security tab on the Properties window and click Edit button. Select the user or group to add additional permission

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜