• encryption (efs) fails on downloads folder

    Home » Forums » AskWoody support » Windows » Windows – other » encryption (efs) fails on downloads folder

    Author
    Topic
    #506493

    Windows 10 Pro, NTFS: My downloads folder is set to encrypt (EFS). Files downloaded to the download folder do not get encrypted. This started becoming a problem in Windows 8.1. Problem was sporadic. In Windows 10 problem is now 100%. No file downloaded to this folder is encrypted. How can I get Windows 10 to observe the “encrypt contents” attribute of this folder?
    Other folders on this machine having the “encrypt contents” attribute work properly. Only the downloads folder fails to work.

    Viewing 5 reply threads
    Author
    Replies
    • #1581285

      I wonder if it’s because, as downloads, they are automatically blocked from some operations. For example:

      45751-blocked
      Click to enlarge

      Have you checked whether unblocking them resolves the encryption issue?

      To save having to go through each file individually you can unblock files en masse using PowerShell. For example, if your downloads folder is C:TempDownloads then you could use the following:

        [*]Right-click on Start.
        [*]Select Command Prompt (Admin).
        [*]When the command prompt window opens, type powershell and press Enter.
        [*]When PowerShell’s PS prompt appears, type the following and press Enter

        Code:
        Get-ChildItem -Path ‘C:TempDownloads’ -Recurse | Unblock-File

      That’s it. Note that unblocking en masse can take some time, obviously depending on how many files are in the Downloads folder. You’ll be able to tell when the operation has finished because the PS prompt will re-appear, as in the following screenshot:

      45752-blocked1
      Click to enlarge

      Try the encryption process again and let us know the result.

      Hope this helps…

    • #1581354

      Edit: I realised that I would be using this process quite often and that I store downloads in different locations so I knocked up a really quick-and-dirty GUI using AutoHotkey. The GUI just pops up a Browse for folder dialog, saves the result as a variable then feeds that to the PowerShell command without displaying the CMD window. (It also obviates the need to ‘allow’ PowerShell scripts so when I compile it I can use it as a portable utility for use on other PCs.)

      45755-unblocker

      It’s become immediately obvious that the unblocking process completes MUCH faster if the CMD/PowerShell command window is not visible. I have no idea why this is the case.

      Hope this helps…

    • #1581358

      ROFL. Well, I was going to offer a compiled version of my AHK UnBlocker script but VirusTotal informs me that my compiled code fails 3 out of 56 scanners. I’ve never heard of these 3 Chinese ‘scanners’ and I know they’re just flagging up the AHK binary within my compiled executable but – hey ho – better safe then sorry, eh?.

      45760-virustotal
      Click to enlarge

      I’ll just post my (hopefully well-documented) AHK source code instead:

      Code:
      ; https://blogs.technet.microsoft.com/heyscriptingguy/2015/01/10/powertip-use-powershell-to-unblock-files-in-folder/
      
      ; Prompt to ‘Run as Admin’, i.e. show UAC dialog
      If Not A_IsAdmin
      {
         Run *RunAs “%A_ScriptFullPath%”  ; Requires v1.0.92.01+
         ExitApp
      }
      
      ; Create the GUI elements
      Gui, Add, Text, x20 y10 w170 h20 , Select SOURCE folder
      Gui, Add, Button, x25 y30 w100 h30 , SOURCE
      Gui, Add, Button, x25 y65 w100 h30 , Cancel
      Gui -SysMenu
      Gui, Show, w150 h100, Windows File Unblocker
      return
      
      ; Determine what the SOURCE button does
      ButtonSOURCE:
      FileSelectFolder, SourceVar, *%A_MyDocuments%, 4, Select a SOURCE folder ;Select a source folder (with default location)
      
      ; Submit the results of the user’s choice
      Gui, submit ;Save the selected folder path to a variable
      ;MsgBox %SourceVar% ;Use MsgBox to test output to commandline
      
      Gui, Destroy ;Close the first GUI so it doesn’t muck up the progress bar
      
      ; Create and run the PowerShell command
      psScript =
      (
          Get-ChildItem -Path ‘%SourceVar%’ -Recurse | Unblock-File
      )
      
      Run PowerShell.exe -Command &{%psScript%} ,, hide
      
      ; Create a second GUI showing looping progress bar (‘cos unblocking loads of files can take some time)
      ; Credit to polyethene for the progress bar routine (https://autohotkey.com/board/topic/12306-infinite-progress-bar/#entry79882)
      
      Gui, Add, Progress, vlvl -Smooth 0x8 w350 h18 ; PBS_MARQUEE = 0x8
      Gui, Show, , Unblocking…    Please wait…
      SetTimer, Unblocking, 45
      Return
      
      Unblocking:
      GuiControl, , lvl, 1
      Process, Exist, powershell.exe, ; Check whether PowerShell still running
      If (!Errorlevel){
      SetTimer, Unblocking, Off ; Turn off process timer
      Gui, Destroy ; Close the second GUI
      
      MsgBox, 64, Windows File Unblocker, Finished! Your files have been unblocked! ; Inform user that process has finished
      ;Run, %SourceVar% ; Open the folder to show files
      ExitApp
      }
      Return
      
      ; Determine what the CANCEL button does
      ButtonCancel:
      ExitApp
      
      Esc::ExitApp ; Use the Esc key to exit the app

      Hope this helps…

    • #1581359
      • #1581361

        A bit like this?
        http://michaelcrump.net/unblock-files-in-windows-8-using-powershell-and-registry/

        It looks good on the surface but I couldn’t get any of the download links in the article (for the .REG file) to work.

        Did you follow any of the download links or recreate the .REG file from the article?

        If so, can you repost the .REG file and let us know whether it works?

        • #1582108

          It looks good on the surface but I couldn’t get any of the download links in the article (for the .REG file) to work.

          Works for me using the following text in a file called unblock.reg.

          Code:
          Windows Registry Editor Version 5.00
          [HKEY_CLASSES_ROOT*shellpowershell]
          @=”Unblock Files”
          [HKEY_CLASSES_ROOT*shellpowershellcommand]
          @=”C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe Unblock-File  -LiteralPath ‘%L'”
          

          cheers, Paul

          • #1582140

            Works for me using the following text in a file called unblock.reg.

            Maybe it’s just me but it appears to stop displaying as more files are selected.

    • #1581416

      In the time since I posted this I have learned a little about the problem. Executive summary: this download issue appears to be a bug in Firefox. As time permits I’ll take it up with those folks. When I use MS Edge the problem does not happen.

      I do not prefer Edge to Firefox.

      Before making the Firefox discovery I made a little batch file. I know I’m lagging behind by not knowing powershell. The batch file issues the following command to encrypt the content of the downloads directory (successfully):
      cipher /e /s:”c:usersMEdownloads”
      I connected the batch file to a shortcut on the desktop (notice the complete lack of elegance) and run it when I’ve downloaded bank statements or anything else that should be encrypted. The shortcut could also be connected to Scheduler.

      Presumably the time will come when Firefox fixes the problem and none of this will be an issue. I did not test Chrome.

      -kc

      • #1582160

        In the time since I posted this I have learned a little about the problem. Executive summary: this download issue appears to be a bug in Firefox. As time permits I’ll take it up with those folks. When I use MS Edge the problem does not happen.

        I do not prefer Edge to Firefox.

        Before making the Firefox discovery I made a little batch file. I know I’m lagging behind by not knowing powershell. The batch file issues the following command to encrypt the content of the downloads directory (successfully):
        cipher /e /s:”c:usersMEdownloads”
        I connected the batch file to a shortcut on the desktop (notice the complete lack of elegance) and run it when I’ve downloaded bank statements or anything else that should be encrypted. The shortcut could also be connected to Scheduler.

        Presumably the time will come when Firefox fixes the problem and none of this will be an issue. I did not test Chrome.

        -kc

        Thanks for reporting back what the issue is.

        PS – Who cares about elegance as long as it works? 🙂

    • #1582159

      Hmmm… I could only select up to 15 files before the right-click menu option to Unblock files disappeared from view. In addition, each ‘unblock’ operation generates a new commandline window and slows the operation badly.

      By comparison, the ‘unblock’ operation using the AHK script wrapper (from post #5) does all the files in a selected folder and is much faster. The AHK script (which I compiled for the purposes of the video) starts at 0.18 seconds in:

    Viewing 5 reply threads
    Reply To: encryption (efs) fails on downloads folder

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: