Is there a utility which you load with a .txt file which is a list of files and directories you made previously, so it generates, sort-of, a virtual directory tree (explorer-like, with icons and all)?

_______________________________

For example:
You have a list, a .txt file, which has this text in it:

C:\abc.bmp
C:\here\pack.rar
C:\here\pack.rar/xyz.bmp

from this info such utility would show you an explorer style directory tree just as if you would browse your hard-drive (it would show icons you currently use for files as well).

If there is not such utility - then - can someone make it - because it's a simple task for a programmer - surely - a small exercise.

(I have files I made with 'total commander' - when you use search and then copy the results to a notepad - it would be nice if I could use them this way)

Dani AI

Generated

wanted a quick way to turn a plain text list (for example, Total Commander search export) into an Explorer-style tree. was right that a Google search helps, but here is a concrete, practical approach you can run right away: build a temporary folder tree that mirrors the listed paths and put .lnk shortcuts into the corresponding folders. Open that root folder in Explorer and you get a real tree with the file-type icons (shortcuts show the target icon with the usual overlay).

A simple PowerShell implementation (set the two variables at the top, then run it):

$ListFile = 'C:\path\to\list.txt'
$Root = 'C:\Temp\VirtualTree'

New-Item -ItemType Directory -Force -Path $Root | Out-Null
$wsh = New-Object -ComObject WScript.Shell

Get-Content $ListFile | ForEach-Object {
  $line = $_.Trim()
  if ([string]::IsNullOrWhiteSpace($line)) { return }
  $line = $line -replace '/', '\'

  if ($line -match '^[A-Za-z]:\\') {
    $drive = $line.Substring(0,1)
    $rel = $line.Substring(3)
  } elseif ($line -match '^\\\\') {
    $drive = 'UNC'
    $rel = $line.TrimStart('\')
  } else {
    Write-Warning "Skipping non-Windows path: $line"
    return
  }

  $parent = Split-Path $rel -Parent
  $destDir = if ($parent) { Join-Path (Join-Path $Root $drive) $parent } else { Join-Path $Root $drive }
  New-Item -ItemType Directory -Path $destDir -Force | Out-Null

  $filename = [System.IO.Path]::GetFileName($line)
  $shortcutPath = Join-Path $destDir ($filename + '.lnk')

  $sc = $wsh.CreateShortcut($shortcutPath)
  $sc.TargetPath = $line
  $sc.WorkingDirectory = Split-Path $line -Parent
  $sc.Save()
}

Notes and troubleshooting: entries that refer to files inside archives are not real filesystem paths and should be extracted first (7‑Zip is a good choice). If you prefer real files instead of shortcuts and all sources are on the same NTFS volume, create hard links with New-Item -ItemType HardLink (see the PowerShell docs). To build a browser-based viewer that embeds real file icons, call the shell API to extract icons (SHGetFileInfo) and generate HTML. References: PowerShell Get-Content/New-Item docs and the Windows Shell SHGetFileInfo documentation, plus 7‑Zip for archive extraction.

Recommended Answers

All 2 Replies

Come on people -- a program which takes list of files saved in txt format and displays it in explorer-style tree?

Come on people --

demanding aren't We !
do a www.google.com search for one,it may take a little research to find it yourself ! myself i don't think you will find one, retail!,sounds like something you would have to build yourself !

also look at the upper part of this page see software development maybe that would be a better place to ask you question

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.