Permission IIS7

Set handlers IIS
appcmd.exe set config /section:handlers /accessPolicy:Read,Script

//===========================================================================
//
//  Topic:    EditPermissionIIS7
//
//  Description: 
//
//  My Name    : MINH KHOA
//
//===========================================================================
 
function EditPermissionIIS7(szSiteName) 
    STRING  szTitle, szMsg; 
    NUMBER  nvFileHandle;
    STRING  szPathDir,szFileNameBat; 
    STRING  para,svDefault;
begin 
     szPathDir=WINDISK^"\\"; 
     szFileNameBat="PermissionIIS7.bat";
     OpenFileMode (FILE_MODE_APPEND); 
     if (CreateFile (nvFileHandle, szPathDir, szFileNameBat) < 0) then 
        abort; 
     else 
    	svDefault ="Default Web site/"+szSiteName;
        para="\"" + svDefault +"\"";
        szMsg =WINDISK^ "\\Windows\\System32\\inetsrv\\appcmd.exe set config /section:handlers /accessPolicy:Read,Script"+" "+ para; 
        if (WriteLine(nvFileHandle, szMsg) < 0) then 
           // MessageBox ("WriteLine failed.", SEVERE);
         else 
           // MessageBox ("WriteLine successfuly.", SEVERE);
        endif; 
     endif; 
     CloseFile (nvFileHandle);
     if LaunchAppAndWait (WINDISK^"\\PermissionIIS7.bat","", WAIT)<0 then
		//MessageBox("khong thanh cong" + szMsg,WARNING);
	 else                              
		//MessageBox("thanh cong"+ szMsg,WARNING); 
	endif;
end;

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: