Access Denied when opening .txt file

APD Toronto
APD Toronto used Ask the Experts™
on
Hi Experts,

When I try to open a text file, I get Access Denied.

When I tried to give full permissions, I get

An error occurred while applying security information to:

C:/inetpub/wwwroot\domain.com\downloads\myfile.txt

Access is denied.

I have also verified that I am that I am the owner of the  file.  I am also logged in as an admin.

I'm using Win 7 Pro x64

Any help will be appreciated
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Yves AccadNetwork Security Engineer

Commented:
From your description it sounds like it may be a UAC issue. As a test can you edit the file if you access it using the UNC?

example:   \\Yourservername\C$\inetpub/wwwroot\domain.com\downloads\myfile.txt
APD TorontoSoftware Developer

Author

Commented:
OK, This is even stranger. When I use the UNC, I don't even see all my files
Files.JPG
Yves AccadNetwork Security Engineer

Commented:
Can you try hitting F5 on the UNC accessed foler? Any change?
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

APD TorontoSoftware Developer

Author

Commented:
No change
Yves AccadNetwork Security Engineer

Commented:
Just to make absolutely sure we're hitting the same folder can you use this UNC instead of what is in the screenshot?

\\Optiplex\C$\inetpub\wwwroot\CRM_COR\attachments\client-1\prog-11
APD TorontoSoftware Developer

Author

Commented:
OK, no idea how, but that listed the files equally.

Still Access deenied.
Yves AccadNetwork Security Engineer

Commented:
One more test please. Right-click notepad > Run as administrator. Then go to the file in question and try to open it, modify and save it. Does it work?
APD TorontoSoftware Developer

Author

Commented:
Opening the file through Notepad as an admin, then modifying it works.

Using File Explorer does not.

How come?
Yves AccadNetwork Security Engineer
Commented:
OK so that verifies that we're dealing with a UAC issue. You don't have access to c:\inetpub although the Administrators group has access to the folder and you are part of the Administrators group because UAC takes precedence.

You can try disabling UAC or set permission using an elevated command prompt ( right-click command prompt and run as administrator)
icacls %systemdrive%\inetpub /grant  %userdomain%\%username%:(OI)(CI)(F) /grant %userdomain%\%username%:F

This will assign your user full control on inetpub.
APD TorontoSoftware Developer

Author

Commented:
When I set this PC 10 years back, I chose "Nataliia & aleks" as the main Admin, then I changed it to APoposki, and now I get...

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>icacls %systemdrive%\inetpub /grant  %userdomain%\%username%:(OI)(CI)(F) /grant %userdomain%\%username%:F
Invalid parameter "OPTIPLEX\Nataliia"
'aleks:' is not recognized as an internal or external command,
operable program or batch file.
The filename, directory name, or volume label syntax is incorrect.

C:\Windows\system32>icacls %systemdrive%\inetpub /grant  %userdomain%\apoposki:(OI)(CI)(F) /grant %userdomain%\%username%:F
Invalid parameter "OPTIPLEX\Nataliia"
The filename, directory name, or volume label syntax is incorrect.

C:\Windows\system32>icacls %systemdrive%\inetpub /grant  %userdomain%\"apoposki":(OI)(CI)(F) /grant %userdomain%\%username%:F
Invalid parameter "OPTIPLEX"apoposki:(OI)(CI)(F) /grant OPTIPLEX\Nataliia "
The filename, directory name, or volume label syntax is incorrect.

C:\Windows\system32>icacls %systemdrive%\inetpub /grant  %userdomain%\"Nataliia & aleks":(OI)(CI)(F) /grant %userdomain%\%username%:F
Invalid parameter "OPTIPLEX"Nataliia"
The filename, directory name, or volume label syntax is incorrect.

C:\Windows\system32>

Open in new window

Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
Do you get Accress Denied when you save the file or when you open it?
EirmanChief Operations Manager

Commented:
Try Unlocker.
It's the most popular file unlocking software out there.

This tip applies to ALL software that you may ever install ...

Take your time installing, so you don't install unwanted toolbars etc.
Don't blindly click YES/OK/Standard Installation - Read before you click!
Andrew LeniartIT Professional | Freelance Journalist | Looking for Opportunities
Distinguished Expert 2018

Commented:
@Eirman,

You're on the wrong track. Unlocker will do nothing to solve an access denied message. The file is not "Locked" - This is clearly a permissions issue and Yves has already proven that.
Chief Operations Manager
Commented:
You're on the wrong track.
Maybe so - Still there is no harm in trying Unlocker (It lists any locking 'handles).

(Perhaps re-booting to safe mode would be worth trying).
APD TorontoSoftware Developer

Author

Commented:
Changing Permissions in Safe Mode did it,

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial