From my understanding, given an input folder, you'd like to flatten
the folder tree/hierarchy and write the result to a text file with the
format you specified.
I've written a PowerShell script to achieve that.
Create a .ps1 text file (e.g. Flatten-Dir.ps1) with the following content:
param
(
# The input/root folder to process
[Parameter(Mandatory = $true)]
[string]$InputFolder,
# The output folder that will contain the flattened folder tree
[Parameter(Mandatory = $true)]
[string]$OutputFile
)
function recdir($InputFolder)
{
Get-ChildItem -Path $InputFolder | foreach {
if($_.Attributes -eq "Directory")
{
Write-Output ("[" + $_.FullName + "]`r`n")
recdir $_.FullName
}
else
{
Write-Output ("[" + $_.FullName + "]`r`n")
}
}
}
Set-Content -Path $OutputFile -Force ("[" + $InputFolder + "]`r`n")
recdir $InputFolder | Add-Content -Path $OutputFile
Then run it in a PowerShell environment, providing the input folder
you want to process, followed by the output file which will contain
the flattened folder tree. For example:
Flatten-Dir.ps1 C:\tmp\Software C:\tmp\flattened_tree.txt
The script uses a custom recursive function in order to achieve that particular desired output. If anyone thinks there's a better/easier way to do it, let me know.
As a test, if this is the folder structure with some files...

... then this is what the script writes in the output file:
[C:\tmp\Software]
[C:\tmp\Software\Soft1]
[C:\tmp\Software\Soft1\run.exe]
[C:\tmp\Software\Soft1\setting.ini]
[C:\tmp\Software\Soft1\test.bat]
[C:\tmp\Software\Soft2]
[C:\tmp\Software\Soft2\Soft3]
[C:\tmp\Software\Soft2\abc.txt]
[C:\tmp\Software\Soft2\def.htm]
[C:\tmp\Software\start.bin]