Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
adee pe Simpatie
Femeie
24 ani
Mures
cauta Barbat
24 - 59 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [WINDOWS] Remove Unblock Attribute For All Files in Subfolders Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
Mrrrr
AdMiN

Inregistrat: acum 18 ani
Postari: 2334
Most files downloaded from the internet, whether is classical download, e-mail attachment, sometimes even LAN, have an Unblock attribute, which you must first check so that you can edit the file.

I have several such excel files downloaded each in its own subfolder together with several other related files for each of the excel files.

Open PowerShell.

The command below identifies the xlsx files that have the "Unblock" attribute and displays their full path in the PowerShell window:

Get-ChildItem "D:\My Main Folder Path" -Recurse -File -Filter *.xlsx -ErrorAction SilentlyContinue |
    ForEach-Object {
        if (Get-Item -LiteralPath $_.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue) { $_.FullName }
    }


Same, with multiple extensions:

Get-ChildItem "D:\My Main Folder Path" -Recurse -File -ErrorAction SilentlyContinue |
    Where-Object { $_.Extension -in ".xlsx", ".xls", ".docx" } |
    ForEach-Object {
        if (Get-Item -LiteralPath $_.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue) { $_.FullName }
    }


Export list to text file:
In any of the codes above, after the ending } add a space, then the pipe character as show below, then the Out-File line on a new line:

|
Out-File "D:\blocked_files.txt" -Encoding UTF8


Unblock by file type (if you are sure what you are doing)

Get-ChildItem "D:\My Main Folder Path" -Recurse -File -Filter *.xlsx | Unblock-File


Source: ChatGPT


_______________________________________


pus acum 37 ore
   
Pagini: 1  

Mergi la