Skip to content

karanikn/FolderNTFS-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FolderNTFS-Tool

GitHub release PowerShell Platform License AI Assisted

A WPF GUI tool for exporting folder structures and NTFS permissions to CSV/TXT, with ACL import and restore capabilities.
Single-file PowerShell script β€” no installation required.


πŸ“Έ Screenshots

Folder Structure Export NTFS Permissions
Folder Structure NTFS Permissions

✨ Overview

FolderNTFS-Tool is a single-file PowerShell WPF application that provides a clean, modern GUI for folder and NTFS permission management. Designed for IT administrators who need quick folder audits, permission reports, ACL backups, or pre-migration documentation without writing one-off scripts.

The tool is organized into two tabs:

  • Folder structure export β€” scan any folder and export its directory tree (up to a configurable depth) to TXT or CSV, using a RAM-safe stack-based enumerator
  • NTFS permissions β€” export ACLs to CSV (streaming mode), and import/restore ACLs from a previously exported CSV with optional reset of existing permissions

All operations log to a real-time Status panel. NTFS imports also create detailed per-run log files.


πŸš€ Quick Start

Set-ExecutionPolicy RemoteSigned -Scope Process
.\FolderNTFS-Tool.ps1

Tip: For NTFS permission import/restore, run as Administrator (required for Set-Acl on protected paths).

Requirements

Requirement Details
OS Windows 10 / 11 / Server 2016+
PowerShell 5.1 or later (PS7 also supported)
.NET Framework 4.5+ (included in Windows 10+)
Permissions Standard user for exports; Run as Administrator for NTFS import/restore

πŸ–₯️ Interface

The application features a tabbed, flat, modern layout:

  • Menu bar β€” File (Exit) Β· Info (Modules status, About)
  • Tab 1: Folder structure export β€” scan folder, output folder, depth, format (TXT/CSV), advanced options, Run button
  • Tab 2: NTFS permissions β€” side-by-side Export (left) and Import (right) panels with advanced filtering options
  • Status panel β€” timestamped real-time log visible from both tabs

πŸ“‹ Tab 1 β€” Folder Structure Export

Scans a folder tree up to the specified depth and exports all discovered directories.

Setting Description
Folder to scan Root folder to start scanning from
Output folder Where to save the export file
Depth How many subfolder levels to include (0 = root only, 1 = one level, etc.)
Format TXT (full paths, one per line) or CSV (FullName + Level columns)

Output filename: FolderStructure_YYYYMMDD_HHMMSS.txt or .csv

Advanced Options

Option Default Description
Ignore missing paths ON Skip inaccessible paths without stopping
Silent mode (no popups) ON Suppress MessageBox dialogs; log only to Status panel
Auto-truncate long paths (>260 chars) ON Truncate paths exceeding MAX_PATH in the output (filesystem unchanged)
Auto-rename invalid filenames OFF Replace invalid filename characters with underscores in output text

How It Works (RAM-Safe)

Unlike Get-ChildItem -Recurse (which loads the entire tree into memory), FolderNTFS-Tool uses a stack-based depth-first traversal with [System.IO.Directory]::EnumerateDirectories(). This streams results one at a time, keeping RAM usage low even on multi-terabyte volumes with hundreds of thousands of folders.


πŸ“‹ Tab 2 β€” NTFS Permissions

Export (Left Panel)

Recursively reads NTFS Access Control Lists and streams every ACE directly to CSV (one row at a time β€” no full list in RAM).

CSV Column Description
Path Full path of the file or folder
Type Directory or File
IdentityReference Security principal (e.g. BUILTIN\Administrators, DOMAIN\User)
FileSystemRights Granted permissions (e.g. FullControl, ReadAndExecute, Synchronize)
AccessControlType Allow or Deny
InheritanceFlags ContainerInherit, ObjectInherit, None
PropagationFlags InheritOnly, NoPropagateInherit, None
IsInherited True if inherited from a parent folder

Output filename: NTFS_Permissions_YYYYMMDD_HHMMSS.csv

Export Advanced Options

Option Default Description
Ignore missing paths ON Skip paths that disappear mid-scan
Silent mode ON No popups, log only
Auto-truncate long paths ON Truncate >260-char paths in CSV output
Always continue on errors ON Never abort the export on ACL read failures
Skip inherited ACEs OFF Exclude ACEs that are inherited from parent objects
Skip SYSTEM/Administrators ACEs OFF Exclude default Windows system ACEs

Import (Right Panel)

Reads a previously exported CSV and applies the ACLs back to the filesystem.

Setting Description
CSV file to import The CSV file from a previous NTFS export
Target root folder (optional) Remap paths to a different root (for migration scenarios)
Apply permissions Actually execute Set-Acl (unchecked = preview mode only)
Reset existing permissions Remove all explicit ACEs before applying new ones from CSV

How Path Remapping Works

When Target root folder is empty, ACLs are applied to the exact paths from the CSV. When a target root is specified, the tool strips the original drive letter and joins the relative path to the new root:

CSV path:    C:\Data\Finance\2024\report.xlsx
Target root: E:\Restored
Result:      E:\Restored\Data\Finance\2024\report.xlsx

Import Advanced Options

Option Default Description
Ignore missing paths ON Skip CSV rows where the target path doesn't exist
Silent mode ON No popups during processing (only summary at end)
Auto-truncate long paths in log ON Shorten long paths in status/log display
Always continue on errors ON Never abort on Set-Acl failures
Skip inherited ACEs from CSV OFF Ignore rows where IsInherited=True
Skip SYSTEM/Administrators ACEs OFF Don't restore default Windows system ACEs

Import Logging

Each import creates a dedicated log file in the FolderNTFS-Tool_Logs folder (next to the script/EXE) with a descriptive filename:

log_20251201_213045_C_Data_Finance__NTFS_Permissions_20251201.csv.txt

After import completes, the tool offers to open the log in Notepad.


πŸ“Š Info Menu

Modules Status

Displays system information relevant to the tool's operation:

  • PowerShell Edition and version
  • Execution policy (current scope)
  • .NET CLR version
  • WPF availability
  • Whether running as Administrator
  • Script path and log directory

About

Shows tool name, author, description, and a clickable link to karanik.gr.


πŸ—‚οΈ File Structure

FolderNTFS-Tool/
β”œβ”€β”€ FolderNTFS-Tool.ps1              ← PowerShell source
β”œβ”€β”€ FolderNTFS-Tool_Logs/            ← Auto-created log directory
β”‚   └── log_YYYYMMDD_HHMMSS_*.txt   ← Per-import log files
β”œβ”€β”€ Screenshots/
β”‚   β”œβ”€β”€ FolderNTFS-Tool_Folders.png  ← Folder structure tab
β”‚   └── FolderNTFS-Tool_NTFS.png    ← NTFS permissions tab
β”œβ”€β”€ LICENSE
└── README.md

πŸ“ Changelog

v2.8.1 β€” April 2026

  • Depth tracking fix β€” folder structure export was ignoring the depth setting and scanning all levels; caused by PowerShell array unrolling on Stack.Push(@(path, depth)) β€” fixed by using [System.Tuple]::Create() which preserves the path/depth pair correctly
  • RAM-safe NTFS export β€” replaced Get-ChildItem -Recurse (loads entire tree into memory) with stack-based [IO.Directory]::EnumerateFileSystemEntries() β€” same streaming approach already used for folder structure export; dramatically reduces memory on large volumes
  • Drive root folder selection fix β€” Show-FolderDialog now correctly handles drive roots (e.g. D:\) where GetDirectoryName returns empty; falls back to GetPathRoot
  • Eliminated $script: scoping in export β€” replaced scriptblock-with-$script: variable pattern with a proper nested function (Write-AcesToCsv) that returns counters via hashtable; more predictable across PS 5.1 and PS 7
  • Version tracking β€” added $script:AppVersion variable; displayed in About window title and Modules status
  • Copyright update β€” About window now shows Β© 2025-2026

v2.8 β€” April 2026

  • Tabbed interface β€” two tabs: Folder structure export / NTFS permissions
  • NTFS permissions import β€” restore ACLs from CSV with preview mode, apply mode, and reset (overwrite) mode
  • Path remapping β€” optional target root for migration scenarios
  • Advanced filtering β€” skip inherited ACEs, skip SYSTEM/Administrators, always-continue, silent mode, auto-truncate
  • Streaming NTFS export β€” writes ACEs directly to CSV row-by-row (low RAM)
  • RAM-safe folder scanner β€” stack-based EnumerateDirectories instead of Get-ChildItem -Recurse
  • Per-import log files β€” detailed logs with descriptive filenames in FolderNTFS-Tool_Logs/
  • Menu bar β€” File (Exit) / Info (Modules status, About)
  • About window β€” with clickable author link
  • Modules status β€” PowerShell edition, .NET version, admin status, WPF availability

v1.0 β€” December 2025

  • Initial release
  • WPF flat modern UI (light mode)
  • Folder structure export with configurable depth (TXT / CSV)
  • NTFS permissions export to CSV (full ACE detail)
  • Modern folder picker dialog
  • Real-time status logging panel

πŸ‘€ Author

Nikolaos Karanikolas β€” karanik.gr


πŸ€– AI Assistance

Built with ChatGPT (OpenAI) and Claude (Anthropic).


⚠️ Disclaimer

Export operations are read-only β€” they use Get-Acl and Get-ChildItem without modifying the filesystem. Import operations modify NTFS ACLs using Set-Acl and can optionally reset existing permissions. Always test on a non-production folder first. The author takes no responsibility for any issues resulting from use of this tool.

About

FolderNTFS-Tool is a single-file PowerShell WPF application that provides a clean, modern GUI for folder and NTFS permission management. Designed for IT administrators who need quick folder audits, permission reports, ACL backups, or pre-migration documentation without writing one-off scripts.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors