for /f "delims=" %%i in ('powershell -noprofile "iex (${%~f0} | out-string)"') do (
echo %%i
) >> list.txt
I want to save the total results from the loop to a variable instead of list.txt, how do I do that?
The powershell dialog box is supplied with:
Add-Type -AssemblyName System.Windows.Forms
$f = new-object Windows.Forms.OpenFileDialog
$f.InitialDirectory = pwd
$f.Filter = "BAM files (*.bam)|*.bam"
$f.ShowHelp = $false
$f.Multiselect = $true
[void]$f.ShowDialog()
if ($f.Multiselect) { $f.FileNames } else { $f.FileName }
Add-Type -AssemblyName System.Windows.Forms
$f = new-object Windows.Forms.OpenFileDialog
$f.InitialDirectory = pwd
$f.Filter = "BED Files (*.bed)|*.bed"
$f.ShowHelp = $false
$f.Multiselect = $false
[void]$f.ShowDialog()
if ($f.Multiselect) { $f.FileNames } else { $f.FileName }
I think the selected files in powershell will by supplied to each iteration in the loop, therefore I want to try output all of them in a variable (I can do it by output to a tmp file but just wondering if I can avoid that).
Really appreciate for anyone who helped!!