Dear Developers,
I have several files stored in different locations, and each file has a different password.
The password corresponding to each file is stored in the text in the same directory.
I have made a txt file for using /cmdfile command to extract all the archives but failed.
Here is the powershell commands I used to generate a txt file:
$item=Get-ChildItem -recurse -filter "*.txt" | Select-Object FullName
write-output "bx -target:name">>F:\Users\user\Downloads\test\test.txt
foreach($i in $item){
$c=get-content $i.fullName
if ($c -match "pass|password"){
$p=Split-Path -Path "$($i.fullName)" -Parent
$pwd=$($c -replace "^.*pass \: |^.*password \: ","")
write-output "$($(Get-ChildItem -path $p\* -include "*.zip","*.rar","*.7z"|`
select-object FullName).fullname|`
foreach-object -process {'"'+$_+'"'}|`
out-string -stream) -p:$pwd">>F:\Users\user\Downloads\test\test.txt
}}
What should I do?