how can unblockseveral files with total commander ?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
giulia
Senior Member
Senior Member
Posts: 336
Joined: 2013-09-14, 05:33 UTC
Location: Europe

how can unblockseveral files with total commander ?

Post by *giulia »

Hi
can i unblock several files with total commander ?

in windows , there is command line for example

Code: Select all

 "unblock-file -path "C:\Users\Brink\Desktop\Example.reg"

thanks
love Total Commander , best file manager ever made
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7022
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: how can unblockseveral files with total commander ?

Post by *Horst.Epp »

giulia wrote:Hi
can i unblock several files with total commander ?

in windows , there is command line for example

Code: Select all

 "unblock-file -path "C:\Users\Brink\Desktop\Example.reg"

thanks
There is no unblock-file command in Windows !
What should such a command do ?
giulia
Senior Member
Senior Member
Posts: 336
Joined: 2013-09-14, 05:33 UTC
Location: Europe

Re: how can unblockseveral files with total commander ?

Post by *giulia »

Horst.Epp wrote:
giulia wrote:Hi
can i unblock several files with total commander ?

in windows , there is command line for example

Code: Select all

 "unblock-file -path "C:\Users\Brink\Desktop\Example.reg"

thanks
There is no unblock-file command in Windows !
What should such a command do ?
hi
i' was talking about this
http://www.tenforums.com/tutorials/5357-unblock-file-windows-10-a.html
thanks
love Total Commander , best file manager ever made
User avatar
Dalai
Power Member
Power Member
Posts: 10033
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

This stuff is stored in NTFS ADS (Alternate Data Streams), so you may use any tool that removes those from files, e.g. Sysinternals Streams or some PowerShell commands (the Wikipedia article mentions that PS 3.0 can natively manage ADS).

[EDIT] Removed the german subpage from the second link. Sorry. [/EDIT]

Regards
Dalai
Last edited by Dalai on 2015-11-16, 16:00 UTC, edited 2 times in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
giulia
Senior Member
Senior Member
Posts: 336
Joined: 2013-09-14, 05:33 UTC
Location: Europe

Post by *giulia »

Dalai wrote:This stuff is stored in NTFS ADS (Alternate Data Streams), so you may use any tool that removes those from files, e.g. Sysinternals Streams or some PowerShell commands (the Wikipedia article mentions that PS 3.0 can natively manage ADS).

Regards
Dalai
hi Dalai
thanks
but seeing there is a command line, i would like to know if total commander can pass files and folders to the unblock-file or get-childitem

thanks
love Total Commander , best file manager ever made
User avatar
Dalai
Power Member
Power Member
Posts: 10033
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

giulia wrote:but seeing there is a command line, i would like to know if total commander can pass files and folders to the unblock-file or get-childitem
Yes, of course. If you want to create a button on the button bar, just press F1 in the according dialog (while editing the button bar) and the help will open with the appropriate page. The help page lists the possible parameters like %S, %P, %N, %L and so on. It depends on the tool you use which parameter is the right one for your task.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Copy and paste this as a button. All selected files will be unblocked.

Code: Select all

TOTALCMD#BAR#DATA
powershell.exe
-noexit -command "& {Get-Content -path '%WL' | Foreach-Object {Unblock-File -LiteralPath $_}}"
powershell.exe



-1
Remove the "noexit" after testing.

*Edit: small fix for special file names (LiteralPath) and quoting.
Last edited by ZoSTeR on 2015-11-16, 23:00 UTC, edited 4 times in total.
giulia
Senior Member
Senior Member
Posts: 336
Joined: 2013-09-14, 05:33 UTC
Location: Europe

Post by *giulia »

ZoSTeR wrote:Copy and paste this as a button. All selected files will be unblocked.

Code: Select all

...
Remove the "noexit" after testing.
hi thanks
like this
Image: http://i.imgur.com/21QfOm6.png
love Total Commander , best file manager ever made
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Not quite. It's a special button format. Just right click on an empty part of the button bar and paste. Or just use:
Command:

Code: Select all

powershell.exe
Parameter:

Code: Select all

-noexit -command "& {Get-Content -Path '%WL' | Foreach-Object {Unblock-File -LiteralPath $_}}"
Last edited by ZoSTeR on 2015-11-16, 22:06 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ZoSTeR,
I would use %WL instead of just %L, also it is not safe to use %L in a double-quoted string (if path will contain dollar char, it won't work). Only process arguments and envvars may be used safely for passing strings, so it implies .ps1 file and command line passing arguments to it (maybe there is a way to pass just script and arguments to powershell but I can't make it working):

Code: Select all

param($a);
write-host "argument is: $a";

Code: Select all

powershell -NoProfile -ExecutionPolicy Bypass -File "F:\1.ps1" "first argument where $vars are not expanded" "second argument etc"
Also I don't understand how you can use nested double-qouted strings. In my quick test powershell just executes passed file because it appears unquoted between two double-quoted strings.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

MVV, you're right. The argument %WL should be in single quotes. Edited above.

To avoid quoting hassle when calling a script see this thread. I had to do some research until I found that solution somewhere.

For your example:
Parameter:

Code: Select all

-NoProfile -ExecutionPolicy Bypass -Command "&{&'F:\File.ps1' 'first argument where $vars are not expanded' 'second argument etc'}"
Always use -LiteralPath where available. Get-ChildItem is tricky/buggy with square brackets.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Wow, actually I haven't used Get-Item in my example and it is not related to script argument parsing, but this oddity definitely should be in mind when Get-Item is used!
giulia
Senior Member
Senior Member
Posts: 336
Joined: 2013-09-14, 05:33 UTC
Location: Europe

Post by *giulia »

ZoSTeR wrote:MVV, you're right. The argument %WL should be in single quotes. Edited above.

To avoid quoting hassle when calling a script see this thread. I had to do some research until I found that solution somewhere.

For your example:
Parameter:

Code: Select all

-NoProfile -ExecutionPolicy Bypass -Command "&{&'F:\File.ps1' 'first argument where $vars are not expanded' 'second argument etc'}"
Always use -LiteralPath where available. Get-ChildItem is tricky/buggy with square brackets.
hi
thanks a lot
seems to work
may i ask you to delete some files i use to delete files or folder (in this case windows.old folder

Code: Select all

takeown /F C:\Windows.old\* /R /A
icacls C:\Windows.old\*.* /T /grant administrators:F
rmdir /S /Q C:\Windows.old\
could be used in total commander?

ps can total commander show and delete Alternate Data Streams?
there are plugins but outdated here
thankshttp://www.ghisler.ch/board/viewtopic.php?t=34506
love Total Commander , best file manager ever made
Post Reply