Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm trying to delete a folder as an administrator, but I get the message "You require permission from UserAdam to delete folder". The problem is, I am logged on as UserAdam! I've tried changing the owner to Administrator to no avail also.
I ran into the same problem: tried to delete a folder (as admin), but got an error message "You need permissions from MYCOMPUTER\Admin ..." Somehow this worked:
I just went into the folder and deleted everything inside. Now when I try to delete the folder, it works fine.
Not sure why, but it seems like you found a similar solution. However, there's no need to use FileAssassin, just simply highlight the folder contents and delete like normal.
I had the same problem, and I found a fairly simple fix that hasn't been mentioned yet and probably has the best chance of working.
Simply give full access to "Everyone" in the file's properties, then delete it right after.
To change the file's access, as administrator: open the context menu and go Properties -> Security -> Advanced. This should bring up a new window that lists multiple users and their access to the file/folder, specifically Everyone. Select Everyone and click edit. In the following menu, select Full Control, then click OK.
The file should now be accessible to everyone- including you- allowing it to be deleted.
This worked for me:
Open command prompt as administrator
Execute rd /S /Q "P:\Ath\To\Directory"
I got no error and my folder was succesfully deleted.
To add some additional detail, in the case of needing permission from yourself, It's likely that you currently have an application that is using a file/ has a lock on that folder/files inside that will throw an error.
Closing relevant applications may remedy this, if not a restart will clear all the file locks which might free it.
If neither of those things work then the ACL permissions on the folder are probably malformed and corrupted somehow
If you have the project open in Visual Studios, close out of it and then delete the file.
Had this problem today and didnt see this answer anywhere
One important "fix" for this issue which must be mentioned:
Try rebooting your machine first!
In some cases this is capable of fixing user control issues, where a file belongs to the current user, yet the current user is unable to change access or remove the file, due to "Access denied".
I think its a bug or something. When the file is in use (It's open in sublime text or maybe some other text editors) it won't say file in use. Instead, it will say you don't have permission. If you don't know what it's open in, logout and it should be deletable. (At least that's what happened to me)
If you tried changing the permissions to 'everyone' for the folder through the security tab and it still asks for "myself"'s permission, then there must be files or folders inside this folder whose permissions need to be changed too. I just found out this, changed the permissions and now happily deleted the troublesome folder.
I had the same issue and I had to enable inheritance.
Related
Is it possible for someone with Administrator access to easily create arbitrary files (e.g. text documents) within the C:\Inetpub\wwwroot folder under Windows 8.1?
Normally right-click presents me with many file types I can create; here, I'm only given the option to create a new sub-folder, even though I can (i) edit existing files there or (ii) create files elsewhere and move them there. (Also, gvim running with administrator access can't create a (new) swap file there).
I created a subfolder ("test"), and took ownership of it, but it made no difference. One of my colleagues thought that this was a "special case" overridden by IIS and could be configured by the Group Policy Editor somehow?
I've heard that disabling UAC solves the problem, but I don't want to do that!
Any ways round this? (Reference to an existing discussion I missed would be fine if it covers the same problem). Thanks!
Smychi
Solved this; I added the specific administrative user account I was logged in under ("User") to the list of permissions and granted myself "Full Control".
Not sure why this didn't already work with the existing groups settings, though I'll admit my knowledge of Windows permissions isn't as good as it should be.
Feel free to say whether this is a good or bad way to do it, or add any comment to this anyway, for my benefit or for others who might stumble across this.
Smychi
To anyone who can help,
So I confess to not being great with computers or apps. In fact, this is my first experience creating an app, so please be nice with me. The app I am creating is for a school project and needs to be able to record audio and save these recordings. In order to do this, I added "AVFoundationFramework" to the build phases under "Link Binary With Libraries" and attempted to edit AVAudioRecorder.h in the style of what it says to do on the online Developer Tools. I got this error message:
"'AVAudioRecorder.h' is locked for editing and you may not be able to save your changes. Do you want to unlock it? 'AVAudioRecorder.h' is currently locked because you are not the current owner of the file and do not have write permission." And then it gives me the options "Don't Unlock" and "Unlock". Note that I got the latest version of Xcode that I am using in the App Store and never moved it or any of the Xcode files I have worked with to or from any other computers, so this should not be an issue.
When I hit "Unlock", this message displays: "The file 'AVAudioRecorder.h' could not be unlocked. Could not add write permission to the file because you do not own it. Try modifying the permissions of the file in the Finder or Terminal."
I did both of those things - I made sure I have Read & Write permission for the folder its in, and I hit "Apply to Enclosed Items" and that didn't work. I got help from someone better with computers than me and we looked in the Terminal and, according to him, I have permission according to the Terminal. I then took my computer to the Apple Store, where they found AVFoundation as a file in my Hard Drive and gave it Read & Write permission in there, and they did some other things as well that I didn't understand involving permissions. They even re-installed my computer and that didn't help.
So I'm at a loss. I apologize if this has been asked already, but I did look and see if anyone had asked similar questions and gotten any answers other than what I have already tried that hasn't worked. The closest I found was this in response to a very similar question with UIViewController.h where he said:
"This looks like you attempted to edit a header file belonging to a system framework in iOS which are protected against unintentional changes like this, possibly because the assistant editor in Xcode (usually shown in the right-hand editor) showed this header at some point.
The only solution here is to revert your changes unless you know exactly why you are making changes in those files."
Sadly I do not know what this means and can't work from there. So if someone can either explain what the above quote means in simple terms OR how to otherwise fix the problem, that would be amazing.
First off, congrats on your first app! To answer answer your question: don't do this! ;-) You should never edit SDK header files. These warnings are for your own benefit. You can really screw things up otherwise. Not sure what info/documentation you were seeing that made you think that you were supposed to, but that's definitely not the right thing to do. But don't feel bad... this stuff is confusing at first.
I would suggest you find an example app that does recording and playback, compile it in Xcode, and make sure it works on your device. Then study it. See how they did things. Create your own Xcode project and try to recreate what they did. That's probably the best way to approach learning this.
Here's a tutorial showing how to use AVAudioRecorder that you might find helpful. Good luck!
http://www.techotopia.com/index.php/Recording_Audio_on_iOS_7_with_AVAudioRecorder
I recently was given Admin rights on my machine on work.
Unfortuanately when I am going through the directory structure I ket geting this message box:
If I hit continue, it works. But it is time consuming and it may be interfering with some of my development efforts.
Is there any way to just get permanent access to everything?
Thanks!
UAC is disable ?
If not, I'll suggest to you to do this :
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
Put EnableLUA to 0 (if you want to reactive UAC put 1)
Others solutions :
http://www.petri.co.il/disable-uac-in-windows-7.htm#
Make new folder,and than copy files.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I'm having a hard time geting Windows to take into account a new entry in my hosts file.
I tried adding this line:
199.229.249.151 models.db
To the hosts file found here:
c:\windows\system32\drivers\etc\hosts
When I save the file and try to reach the host with a browser, I'm getting a "host not found" error. I tried setting the "read-only" file attribute to the hosts file -- same result. I tried flushing the DNS cache, but nothing changes.
It seems Windows is not reading my modified hosts file at all, or at least, not taking in account my new entry.
What am I forgetting? What else could I try?
Are there specific requirements or rules to follow to ensure that Windows can always properly detect a change to the hosts file, read and parse its contents, and immediately take into account changes when using a browser or ping to test via the command-line?
I ran into same issue and after checking lot of things, the issue ended up being the line endings, I had change the line endings to Windows format and it worked.
I ran into this problem once, The problem is Windows ignored the host file and I fixed it by:
Copy the hosts file from C:\Windows\System32\drivers\etc to somewhere like Desktop
Remove the hosts file there
Copy the copied hosts file back to C:\Windows\System32\drivers\etc
I don't know why but it's fixed.
Automatic proxy server configuration scripts override the hosts file. To disable the automatic configuration script:
Press Windows key and type Configure proxy server
Click LAN settings
Uncheck Use automatic configuration script
Try ping localhost.
if it works, then something wrong with ip or your entry. If it does not, hosts file is bad. Pay attention where it goes. It might try ipv6. That still means that hosts file is broken.
Remove everything from it and leave only your entry or localhost. Single line only, nothing else at all! Not even line breaks. Just stash it aside somewhere until problem is resolved.
If it works, then there's an entry that breaks things. Try converting line endings to windows format, might help. Usually it's white space that messes with things because it's hard to notice.
Open Notepad > Start Open Notepad > Open as administrator.
Save it at some location as ANSI hosts file (Not .txt extension, select all files and name it as hosts)
Copy all the hosts files entries and save it.
Finally copy the hosts file copied at the desired location say : C:\tempfolder\hosts to c:windows\system32\drivers\etc folder.
I encounter the same issue, and find my host is unicode, after change it to ANSI, the issue is fixed
I am working on a WinForm application, that allows working to work with "projects" (think about the application as Visual Studio, and projects as VS Solutions).
My question is - where should the application keep its logging files?
Some requirements include:
the application might not be running as an administrator (so saving in the %ProgramFiles% installation folder is not a good option)
The logs should be accessible to end-users (either for review, or for sending to the support team). (This means that hard to find folders, like %AppData%\Company\Application\Version\ProjectName... are not a good solution either)
The application might generate logs even when there are no open projects (so saving the logs in the project's folder is good only when there's a project, but not a final solution).
I was thinking of creating a "working folder" when the application is installed - something along the lines of C:\Application\, and then save the logs in a subfolder, like %WorkingFolder%\Logs\ProjectName
Thanks for the input.
Somewhere in the user's directory is actually the correct place to store them if they are specific to the current running user.
Some programs create folders at the top level of the User's directory, next to Documents and Desktop, others do it in Documents.
Creating it in C:\ might cause issues if the user doesn't have write access to the root directory. You can pretty much guarantee the user will have write access to the Home directory.
The other option is to look for an environment variable, and if its set use the value as the location, if not default to the User's home directory.
If the logs are user only you should store them at %AppData%\Company\Application Name.
If the logs are shared (any user can see any log) you should store them at:
%ProgramData%\Company\Application Name (for Vista+)
or
%AllUsersProfile%\Application Data\Company\Application Name (for XP-)
As for user access, you can add a shortcut to the start menu to the appropriate location or have a link within the program.
Another option in Vista+ is the Public folder (%Public%) which has links throughout Explorer for easy access to.
Where should I write program data instead of Program Files is a good blog entry by Chris Jackson from Microsoft. While it isn't an "official stance" it holds some excellent information.
You can always ask the user to configure this. Set a default path, maybe the application directory. During installation or while setting up the application you may prompt the user to input the path they want to use for logs. That's fair, right. If they're advanced enough to use logs they're good enough to configure a path too.
What do you plan to do with the logs. Are they technical, of for financial/security audits?
The EventLog is a nice place for technical logs, because you can access it remotely (within the Domain) and it is cleaned up automatically.
The %AppData% is also a good place for technical logs, specially if you are unable to connect to the eventlog. You can find the log files, and you can direct the end-user to them, but they are not "in the face" of the end-user. You can include a "send log to the maker" button to receive them.
For logs that needs be accessed by end-users, the My Documents (or a subfolder) looks good.
You can just to add button / menu item to easy open folder with logs.
Best place fo logs are %AppData%\AppName or %temp%\AppName.
Never use %MyDocs% or %Program Files%.
I'd suggest adding that question to the installer so that the user that installs the software can decide where best to put the logs. Though C:\[AppName\ sounds like a reasonable default for your requirements.
Edit: Just thought off, it would probably be worth warning the user if the select a bad location (in Program Files or in the root of the system drive etc) and if they choose to create a new directory, automatically give that directory correct permissions during the installation.
I think %APPDATA%\YourCompanyName\YourAppName is the preferred location. To overcome your stated objection of this location being hard to find, you could pretty easily and quickly implement a simple support screen in your app to allow the end user the ability to access and email these logs without too much trouble, so that the user will not have to remember or manually navigate to the long path name to get to the logs.
I don't really like the idea of the user being able to set this location via the installer because of possible naming and permission issues.
If the app needs to maintain the log only for the users current logged in timespan, then you could keep it in c:/temp.
Most of my winapps, i leave it there, so automatically it gets deleted once the user logs off..
Ofcourse, this primarily depends on your requirement.