Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Feb 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    encryption (efs) fails on downloads folder

    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.

  2. #2
    Super Moderator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    2,143
    Thanks
    101
    Thanked 580 Times in 464 Posts
    I wonder if it's because, as downloads, they are automatically blocked from some operations. For example:

    blocked.png
    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:\Temp\Downloads then you could use the following:

    1. Right-click on Start.
    2. Select Command Prompt (Admin).
    3. When the command prompt window opens, type powershell and press Enter.
    4. When PowerShell's PS prompt appears, type the following and press Enter
      Code:
      Get-ChildItem -Path 'C:\Temp\Downloads\' -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:

    blocked1.png
    Click to enlarge

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

    Hope this helps...

  3. #3
    Super Moderator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    2,143
    Thanks
    101
    Thanked 580 Times in 464 Posts
    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.)

    unblocker.png

    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...
    Last edited by Rick Corbett; 2016-10-14 at 19:58. Reason: Added screenshot

  4. #4
    Super Moderator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    2,143
    Thanks
    101
    Thanked 580 Times in 464 Posts
    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?.

    virustotal.png
    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...
    Last edited by Rick Corbett; 2016-10-14 at 20:10. Reason: Fixed the code so the progress bar works

  5. #5
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts

  6. #6
    Super Moderator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    2,143
    Thanks
    101
    Thanked 580 Times in 464 Posts
    Quote Originally Posted by Paul T
    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?
    Last edited by Rick Corbett; 2016-10-13 at 14:43. Reason: Added more info

  7. #7
    New Lounger
    Join Date
    Feb 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:\users\ME\downloads"
    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

  8. #8
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    Quote Originally Posted by Rick Corbett View Post
    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\*\shell\powershell]
    @="Unblock Files"
    [HKEY_CLASSES_ROOT\*\shell\powershell\command]
    @="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe Unblock-File  -LiteralPath '%L'"
    cheers, Paul

  9. #9
    Super Moderator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    2,143
    Thanks
    101
    Thanked 580 Times in 464 Posts
    Quote Originally Posted by Paul T
    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.


  10. #10
    Super Moderator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    2,143
    Thanks
    101
    Thanked 580 Times in 464 Posts
    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:


  11. #11
    Super Moderator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    2,143
    Thanks
    101
    Thanked 580 Times in 464 Posts
    Quote Originally Posted by KCGarrett
    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:\users\ME\downloads"
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •