• Restoring access to your own files after Windows 10 updates

    Restoring access to your own files after Windows 10 updates

    TL;DR

    Sometimes, when Windows 10 is updated, a number of files become inaccessible. Use the icacls command to regain access to this files.

    After applying an update to Windows 10, in October 2016, my Windows temporary directory was updated such that I re-encountered some of the problems I’d experienced earlier in the year. When I fixed the problem I didn’t write down the actions that I’d taken to restore access to my own files. This time I did.

    In each directory where files are not accessible I typed two commands

    takeown /F *.jpg /A
    icacls * /grant QW:(OI)(CI)F /T

    You also have to give yourself access to the System windows temporary directory identified by environment variable TMP or TEMP. In my case, on QW the directory was  C:\Windows\Temp.

    If you don’t do this then the original file, when copied to the uploads directory, will not be accessible. In explorer you won’t see its thumbnail.

    Another way to fix the problem would be to take a look at the options in [api get_temp_dir].

    Resources

    I found some answers using StackOverflow. The older answers only mentioned cacls. The updated ones referred to icacls and takeown. Whether or not I needed to run takeown I don’t really know. I hope I won’t have to revisit this again in the near future.

    Problem revisited – Jan 2020

    … It’s happened quite a few times since. Today I noticed a problem with attachments that had not been cloned to oik-plugins.co.uk. I discovered that the target files were 0 bytes. When I attempted to ftp the original files ( into wp-content/uploads/2019/10 ) it failed because Filezilla could not access the source files.

    On my new machine (SB) I now run a simple batch command ic.bat. Note: This has to be invoked from a Command Prompt started with Run as administrator.

    icacls * /grant SB:(OI)(CI)(F) /T

    Temporary files folder

    On SB the settings of TEMP and TMP environment variables point to a different folder.

    TEMP=C:\Users\herb\AppData\Local\Temp
    TMP=C:\Users\herb\AppData\Local\Temp

    The folder currently contains files that I didn’t really expect to be there.

    • Many folders named phpcsfixer_temp.tmpnnnn, phpcs_temp.tmpnnnn with subfolders containing nothing. These are associated with PHPCS and PHPCS Fixer, which are run by PHPStorm. See https://www.jetbrains.com/help/phpstorm/using-php-code-sniffer.html
    • A load of 0 bytes files named mat-debug-nnnn.log; one every 15 to 20 minutes. These may be related to Microsoft Application Telemetry.
    • And some files I might have expected to see.

    By the way. I still don’t know whether or not I should run `ic.bat` against this directory. I have just done so. Let’s see if this makes any difference.

    Reference

    Original problem: H2GD Part 54: Windows 10 butterfly effect



    Published:

    Last updated:

    January 9, 2020

Today’s word is this:

Tuesday

Food-le.com

crust

Foodlewordle.io

seeds

Categories

Tide times from tidetimes.org.uk

Tide Times & Heights for Langstone Harbour on
5th March 2024
06:06 High Tide ( 3.81m )
11:40 Low Tide ( 1.97m )
18:51 High Tide ( 3.71m )

Tide times from tidetimes.org.uk

Tide Times & Heights for Northney on
5th March 2024
06:33 High Tide ( 3.43m )
12:16 Low Tide ( 1.78m )
19:26 High Tide ( 3.41m )