Windows 10 command prompt--"The process cannot access the file because it is being used by another process."

13,069

If you current log on account has admin permission, please try to manually add permission on the log file:

  1. Right click the log file and select Properties – Security.
  2. There will be a message about read permission, just click Advanced – Continue.
  3. Click Add – Select a principal.
  4. Manually enter your user account and click Check Name, once it has been detected, click OK.
  5. Select Full control permission and click OK to save the change.
  6. Click Ok again to save the security change.

Then, re-open the file and you will see all content.

Share:
13,069
Simonhawk
Author by

Simonhawk

Updated on September 18, 2022

Comments

  • Simonhawk
    Simonhawk over 1 year

    Trying to open my firewall log file through command line and create a shortcut for it because I can't open it without admin privileges and when I right click, "Run as admin" is not showing **as shown here** I did try going through the settings and adding my account for permissions but I believe since it's a dynamic file, it just resets because after awhile, I would have to redo the process and that's why I was trying to make a shortcut. Need someone to assist me in fixing this problem one way or another so I can view log files on my Windows 10 home computer.

    Thank you!

    added pic: enter image description here

    • Appleoddity
      Appleoddity over 6 years
      You’ve explained only part of what you want to do. You haven’t provided any info on what you’ve already tried to make this happen. We have no idea what you want to open these files in. In your title you state an error message but haven’t told us what you do to produce that error. Is that the message you get when you try to open your firewall log?
    • magicandre1981
      magicandre1981 over 6 years
      you need to stop the Firewall service before you can open the log file
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style over 6 years
      Wonder if it would allow you to first copy the log file elsewhere and then open it from the elsewhere location without stopping the FW service? Thinking of a potential simple workaround solution that may suffice for the immediate need once confirming it works as expected but simple enough to try.
    • Simonhawk
      Simonhawk over 6 years
      @ITSnuggles Having to copy the file over each time is a drag. Is there not a simply, more efficient way of doing this? I believed I've poked at logs before and never had this issue.
    • Simonhawk
      Simonhawk over 6 years
      @Appleoddity I didn't show any specific commands, but I did say in the first line that I tried to open it via command line. What gave me this error is using the "start" function (ex: "start C:\path...\Firewall.log"
    • Appleoddity
      Appleoddity over 6 years
      You don’t tell us WHAT PROGRAM you want to open your logs in. We can’t guess from your picture. What I can clearly see is that the .log files are NOT what you are trying to open. The icon shows those will open in notepad. The file you’ve right clicked on is not a .LOG file, but because you are also hiding file extensions I can’t guess at what it is, but the icon shows it is different and it is not opening in notepad. The command line you just provided is not what you really tried because the file firewall.log does not exist. Complete filenames and programs are important here. This is simple.
    • Appleoddity
      Appleoddity over 6 years
      Start by unhiding file extensions for known file types so you can clearly see what type of files you are working with.
    • Simonhawk
      Simonhawk over 6 years
      @Appleoddity regular notepad. I added a picture of opening it from the file.
    • Appleoddity
      Appleoddity over 6 years
      Thank you for the extra info. It is getting more clear now, but it appears we are dealing with two issues. Can you run notepad as administrator and then use the file menu to navigate to, and open the log?
  • Simonhawk
    Simonhawk over 6 years
    I already did this. I even said it in the OP. I assume because log files are constantly updating, the permissions have to be reinstated. This is my assumption because after awhile, I have to add permissions again
  • Appleoddity
    Appleoddity over 6 years
    @Simonhawk it’s very simply, not a permission issue. Nothing about the error message suggests that.