File Explorer is a simple, fast, and user‑friendly file management application designed to make navigating, organizing, and manipulating files intuitive for all users. It combines a clean graphical interface with a powerful built‑in Command Line Interface (CLI) for users who prefer keyboard‑driven workflows.
- Navigation: Browse directories using a tree view and list view.
- File Operations: Perform essential actions such as:
- Change Directory (
cd) - Copy files and directories (
copy) - Move files and directories (
move) - Delete files and directories (
delete)
- Change Directory (
- Clipboard Support: Cut, copy, and paste files and folders.
- Context Menu: Right‑click menus for quick access to common actions.
- History Tracking: Move backward and forward through previously visited directories.
- File Type Icons: Visual indicators for different file types.
- Status Bar: Real‑time feedback on operations and system status.
For users who enjoy the speed and precision of typed commands, the built‑in CLI provides:
- Fast directory navigation (
cd) - File and folder operations (
copy,move,delete,rename) - Text file creation (
text,txt) - Search and result cycling (
find,findnext) - Contextual path handling (type a path to open it)
- Quoting rules for paths with spaces
- Helpful usage messages and error feedback
- A built‑in
helpcommand with full documentation
The CLI and GUI work together seamlessly, giving users the freedom to choose the workflow that suits them best.
-
🖥️ Command Line Interface (CLI)
- Features Overview
- Commands
- cd — Change Directory
- mkdir / make — Create Directory
- copy — Copy Files or Folders
- move — Move Files or Folders
- delete — Delete Files or Folders
- rename — Rename Files or Folders
- text / txt — Create Text Files
- open — Open Files or Folders
- find / search — Search
- findnext / searchnext — Next Search Result
- help — Show Help
- Quoting Rules
- Contextual Navigation
- Example Session
The Command Line Interface (CLI) is an integrated text‑based command system inside the File Explorer application. It allows users to navigate folders, manage files, and perform common operations quickly using typed commands.
The CLI is designed to be:
- Fast — no menus, no dialogs
- Predictable — clear rules and consistent behavior
- Beginner‑friendly — helpful messages and examples
- Powerful — supports navigation, search, file operations, and more
- Change directories
- Open files directly
- Navigate to folders by typing their path
- Supports paths with spaces using quotes
- Create, copy, move, rename, and delete
- Works with both files and directories
- Handles quoted paths safely
- Search the current folder
- Cycle through results with
findnext - Highlights and selects results in the UI
If a command doesn’t match a known keyword, the CLI checks:
- Is it a folder? → Navigate to it
- Is it a file? → Open it
- Otherwise → “Unknown command”
This makes the CLI feel natural and forgiving.
Below is the complete list of supported commands, including syntax, descriptions, and examples.
Usage:
cd [directory]
Description:
Changes the current working directory.
Examples:
cd C:\
cd "C:\My Folder"
Usage:
mkdir [directory_path]
Description:
Creates a new folder.
Examples:
mkdir C:\newfolder
make "C:\My New Folder"
Usage:
copy [source] [destination]
Description:
Copies a file or folder to a destination directory.
Examples:
copy C:\folderA\file.txt C:\folderB
copy "C:\folder A" "C:\folder B"
Usage:
move [source] [destination]
Description:
Moves a file or folder to a new location.
Examples:
move C:\folderA\file.txt C:\folderB\file.txt
move "C:\folder A\file.txt" "C:\folder B\renamed.txt"
Usage:
delete [file_or_directory]
Description:
Deletes a file or folder.
Examples:
delete C:\file.txt
delete "C:\My Folder"
Usage:
rename [source_path] [new_name]
Important:
Paths containing spaces must be enclosed in quotes.
Examples:
rename "C:\folder\oldname.txt" "newname.txt"
rename "C:\folder\old name.txt" "new name.txt"
Usage:
text [file_path]
Description:
Creates a new text file at the specified path and opens it.
Example:
text "C:\folder\example.txt"
If no file name is provided, the CLI creates a new file named:
New Text File.txt
Usage:
open [file_or_directory]
Description:
Opens a file with its default application, or navigates into a folder.
If no path is provided, the command opens the currently selected file or folder in the File Explorer list.
Examples:
open C:\folder\file.txt
open "C:\My Folder"
open
Behavior:
- If the target is a file → opens it using the default program
- If the target is a folder → navigates into it
- If nothing is selected and no path is provided → shows usage help
- Supports quoted paths with spaces
Usage:
find [search_term]
Description:
Searches the current folder for files or folders containing the term.
Example:
find report
If results are found:
- The first result is automatically selected
- The status bar shows how many matches were found
Usage:
findnext
Description:
Cycles to the next result from the previous search.
Wraps around when reaching the end.
Closes the application.
Displays the full list of commands.
Paths containing spaces must be enclosed in quotes:
"C:\My Folder"
"C:\Users\Joe\My File.txt"
This applies to:
cdcopymoverenamedeletetext
The CLI will warn the user when quotes are required.
If the user enters something that is not a command:
- If it’s a folder path, the CLI navigates to it
- If it’s a file path, the CLI opens it
- Otherwise, the CLI shows an “Unknown command” message
This makes the CLI feel natural and forgiving.
> cd C:\Users\Joe
Navigated To: C:\Users\Joe
> copy "C:\Users\Joe\file.txt" "C:\Users\Joe\Documents"
Copied file: file.txt to: C:\Users\Joe\Documents
> find report
Found 3 result(s). Showing result 1. Type findnext to move to the next match.
> findnext
Showing result 2 of 3
> help
(Displays full help text)
The File Explorer CLI provides:
- Fast directory navigation
- Powerful file operations
- Search with result cycling
- Intelligent path handling
- Clear feedback and usage messages
- Beginner‑friendly quoting rules
- Contextual file/folder opening
It’s a flexible, efficient alternative to the graphical interface — perfect for users who enjoy command‑driven workflows.
This method renames either a file or a folder, following a clear set of safety rules. Each rule protects the user from mistakes and helps them understand what’s happening.
Below is the full code, then we’ll walk through it one step at a time.
Private Sub RenameFileOrDirectory(sourcePath As String, newName As String)
Dim newPath As String = Path.Combine(Path.GetDirectoryName(sourcePath), newName)
' Rule 1: Path must be absolute (start with C:\ or similar).
' Reject relative paths outright
If Not Path.IsPathRooted(sourcePath) Then
ShowStatus(IconDialog & " Rename failed: Path must be absolute. Example: C:\folder")
Exit Sub
End If
' Rule 2: Protected paths are never renamed.
' Check if the path is in the protected list
If IsProtectedPathOrFolder(sourcePath) Then
' The path is protected; prevent rename
' Show user the directory so they can see it wasn't renamed.
NavigateTo(sourcePath)
' Notify the user of the prevention so the user knows why it didn't rename.
ShowStatus(IconProtect & " Rename prevented for protected path or folder: " & sourcePath)
Exit Sub
End If
Try
' Rule 3: If it’s a folder, rename the folder and show the new folder.
' If source is a directory
If Directory.Exists(sourcePath) Then
' Rename directory
Directory.Move(sourcePath, newPath)
' Navigate to the renamed directory
NavigateTo(newPath)
ShowStatus(IconSuccess & " Renamed Folder to: " & newName)
' Rule 4: If it’s a file, rename the file and show its folder.
' If source is a file
ElseIf File.Exists(sourcePath) Then
' Rename file
File.Move(sourcePath, newPath)
' Navigate to the directory of the renamed file
NavigateTo(Path.GetDirectoryName(sourcePath))
ShowStatus(IconSuccess & " Renamed File to: " & newName)
' Rule 5: If nothing exists at that path, explain the quoting rule for spaces.
Else
' Path does not exist
ShowStatus(IconError & " Renamed failed: No path. Paths with spaces must be enclosed in quotes. Example: rename ""[source_path]"" ""[new_name]"" e.g., rename ""C:\folder\old name.txt"" ""new name.txt""")
End If
Catch ex As Exception
' Rule 6: If anything goes wrong,show a status message.
ShowStatus(IconError & " Rename failed: " & ex.Message)
Debug.WriteLine("RenameFileOrDirectory Error: " & ex.Message)
End Try
End Sub
Private Sub RenameFileOrDirectory(sourcePath As String, newName As String)- sourcePath — the full path to the file or folder you want to rename
- newName — just the new name (not a full path)
Dim newPath As String = Path.Combine(Path.GetDirectoryName(sourcePath), newName)- Extracts the folder that contains the item
- Combines it with the new name
- Example:
sourcePath = "C:\Stuff\Old.txt"newName = "New.txt"newPath = "C:\Stuff\New.txt"
If Not Path.IsPathRooted(sourcePath) Then
ShowStatus(IconDialog & " Rename failed: Path must be absolute. Example: C:\folder")
Exit Sub
End IfBeginners often type relative paths like folder\file.txt.
This rule stops the rename and explains the correct format.
If IsProtectedPathOrFolder(sourcePath) Then
NavigateTo(sourcePath)
ShowStatus(IconProtect & " Rename prevented for protected path or folder: " & sourcePath)
Exit Sub
End IfSome paths should never be renamed (system folders, app folders, etc.).
This rule:
- Prevents the rename
- Shows the user the original folder
- Explains why the rename was blocked
This is excellent for learner clarity.
Try
...
Catch ex As Exception
ShowStatus(IconError & " Rename failed: " & ex.Message)
Debug.WriteLine("RenameFileOrDirectory Error: " & ex.Message)
End TryAnything inside the Try block that fails will be caught and explained.
Beginners get a friendly message instead of a crash.
If Directory.Exists(sourcePath) Then
Directory.Move(sourcePath, newPath)
NavigateTo(newPath)
ShowStatus(IconSuccess & " Renamed Folder to: " & newName)- Checks if the path points to a directory
- Renames it
- Shows the user the newly renamed folder
This reinforces the idea that folders are “containers” and have their own identity.
ElseIf File.Exists(sourcePath) Then
File.Move(sourcePath, newPath)
NavigateTo(Path.GetDirectoryName(sourcePath))
ShowStatus(IconSuccess & " Renamed File to: " & newName)- Checks if the path points to a file
- Renames it
- Shows the user the folder containing the renamed file
This keeps the UI consistent and predictable.
Else
ShowStatus(IconError & " Renamed failed: No path. Paths with spaces must be enclosed in quotes. Example: rename ""[source_path]"" ""[new_name]"" e.g., rename ""C:\folder\old name.txt"" ""new name.txt""")
End IfBeginners often forget to quote paths with spaces.
This rule:
- Detects the missing path
- Explains the quoting rule
- Gives both a template and a real example
This is excellent pedagogy.
Catch ex As Exception
ShowStatus(IconError & " Rename failed: " & ex.Message)
Debug.WriteLine("RenameFileOrDirectory Error: " & ex.Message)
End Try- No crashes
- Clear feedback
- Debug info for you
This method teaches six important rules:
- Paths must be absolute
- Protected paths cannot be renamed
- Folders are renamed and then shown
- Files are renamed and their folder is shown
- Missing paths trigger a helpful quoting explanation
- Any error is caught and explained safely
This method copies an entire directory — including all files and all subfolders — into a new destination. It uses recursion, meaning the method calls itself to handle deeper levels of folders.
Below is the full code, then we’ll walk through it one small step at a time.
Private Sub CopyDirectory(sourceDir As String, destDir As String)
Dim dirInfo As New DirectoryInfo(sourceDir)
If Not dirInfo.Exists Then
ShowStatus(IconError & " Source directory not found: " & sourceDir)
Exit Sub
End If
Try
ShowStatus(IconCopy & " Create destination directory:" & destDir)
' Create destination directory
Directory.CreateDirectory(destDir)
ShowStatus(IconCopy & " Copying files to destination directory:" & destDir)
' Copy files
For Each file In dirInfo.GetFiles()
Dim targetFilePath = Path.Combine(destDir, file.Name)
file.CopyTo(targetFilePath, overwrite:=True)
Next
ShowStatus(IconCopy & " Copying subdirectories.")
' Copy subdirectories recursively
For Each subDir In dirInfo.GetDirectories()
Dim newDest = Path.Combine(destDir, subDir.Name)
CopyDirectory(subDir.FullName, newDest)
Next
' Refresh the view to show the copied directory
NavigateTo(destDir)
ShowStatus(IconSuccess & " Copied into " & destDir)
Catch ex As Exception
ShowStatus(IconError & " Copy failed: " & ex.Message)
Debug.WriteLine("CopyDirectory Error: " & ex.Message)
End Try
End Sub
Private Sub CopyDirectory(sourceDir As String, destDir As String)- sourceDir — the folder you want to copy
- destDir — where the copy should be created
Dim dirInfo As New DirectoryInfo(sourceDir)DirectoryInfogives you access to:- the folder’s files
- its subfolders
- metadata
- It’s a convenient wrapper around a directory path.
If Not dirInfo.Exists Then
ShowStatus(IconError & " Source directory not found: " & sourceDir)
Exit Sub
End If- If the folder doesn’t exist, we stop immediately.
- Beginners often mistype paths, so this prevents confusing errors.
- The user gets a clear, friendly message.
TryEverything inside this block is protected.
If anything goes wrong (permissions, locked files, etc.), the Catch block will handle it gracefully.
ShowStatus(IconCopy & " Create destination directory:" & destDir)This gives immediate feedback so the UI feels alive and responsive.
Directory.CreateDirectory(destDir)- If the folder already exists, nothing bad happens.
- If it doesn’t exist, it is created.
- Either way, the destination is now ready.
ShowStatus(IconCopy & " Copying files to destination directory:" & destDir)This message helps user understand the sequence of operations.
For Each file In dirInfo.GetFiles()
Dim targetFilePath = Path.Combine(destDir, file.Name)
file.CopyTo(targetFilePath, overwrite:=True)
NextGetFiles()returns all files directly inside the folder.Path.Combinebuilds the full destination path.CopyTo(..., overwrite:=True)ensures:- files are copied
- existing files are replaced
This loop handles only the files — not subfolders.
ShowStatus(IconCopy & " Copying subdirectories.")This prepares the user for the next step: recursion.
For Each subDir In dirInfo.GetDirectories()
Dim newDest = Path.Combine(destDir, subDir.Name)
CopyDirectory(subDir.FullName, newDest)
NextThis is the heart of the algorithm.
GetDirectories()returns all subfolders.- For each subfolder:
- Build a new destination path
- Call CopyDirectory again on that subfolder
This technique is called recursion — the function keeps calling itself until it reaches the deepest level of the folder tree.
Beginners often find this magical once they see it in action.
NavigateTo(destDir)This helps the user visually confirm the copy succeeded.
ShowStatus(IconSuccess & " Copied into " & destDir)Clear, friendly confirmation that the operation completed.
Catch ex As Exception
ShowStatus(IconError & " Copy failed: " & ex.Message)
Debug.WriteLine("CopyDirectory Error: " & ex.Message)
End TryIf anything goes wrong:
- The user gets a helpful message
- You get a debug log for troubleshooting
This keeps the app stable and user‑friendly.
This method shows:
- How to check whether a directory exists
- How to create directories safely
- How to copy files
- How to copy subfolders using recursion
- How to build paths correctly
- How to give user feedback
- How to handle errors without crashing
This diagram shows exactly how the CopyDirectory routine walks the tree.
Imagine your folder structure looks like this:
SourceDir
├── FileA.txt
├── FileB.txt
├── Sub1
│ ├── FileC.txt
│ └── Sub1A
│ └── FileD.txt
└── Sub2
└── FileE.txt
The method processes it in this exact order.
CopyDirectory(SourceDir, DestDir)
│
├── Copy files in SourceDir
│
├── For each subdirectory:
│ ├── CopyDirectory(Sub1, DestDir/Sub1)
│ │ ├── Copy files in Sub1
│ │ ├── CopyDirectory(Sub1A, DestDir/Sub1/Sub1A)
│ │ │ ├── Copy files in Sub1A
│ │ │ └── (Sub1A has no more subfolders → return)
│ │ └── (Sub1 done → return)
│ │
│ └── CopyDirectory(Sub2, DestDir/Sub2)
│ ├── Copy files in Sub2
│ └── (Sub2 has no more subfolders → return)
│
└── All subdirectories processed → return to caller
This shows how the call stack grows and shrinks as recursion happens.
Call 1: CopyDirectory(SourceDir)
├── copies files
├── enters Sub1 → Call 2
Call 2: CopyDirectory(Sub1)
├── copies files
├── enters Sub1A → Call 3
Call 3: CopyDirectory(Sub1A)
├── copies files
└── no subfolders → return to Call 2
Back to Call 2:
└── Sub1 done → return to Call 1
Back to Call 1:
├── enters Sub2 → Call 4
Call 4: CopyDirectory(Sub2)
├── copies files
└── no subfolders → return to Call 1
Back to Call 1:
└── all done → return to caller
Each level of indentation = one level deeper in recursion.
CopyDirectory(SourceDir)
CopyDirectory(Sub1)
CopyDirectory(Sub1A)
CopyDirectory(Sub2)
This is the simplest way to show the “shape” of recursion.
- Start at the root folder.
- Copy its files.
- For each subfolder:
- Step into it
- Treat it like a brand‑new root
- Copy its files
- Repeat the process for its subfolders
- When a folder has no subfolders, return to the previous level.
- Continue until you climb all the way back to the top.
This walkthrough explains how the MoveFileOrDirectory routine works inside the file‑manager project. The goal of this method is to safely move files or directories while providing clear, user‑friendly feedback and preventing dangerous or confusing operations.
MoveFileOrDirectory(source, destination) performs a safe move operation with:
- Input validation
- Protected‑path checks
- Self‑move and recursive‑move prevention
- Automatic creation of destination directories
- User‑visible navigation before and after the move
- Clear status messages for every outcome
This mirrors the project’s design philosophy:
Show → Confirm → Act → Show Result
Private Sub MoveFileOrDirectory(source As String, destination As String)
Try
' Validate parameters
If String.IsNullOrWhiteSpace(source) OrElse String.IsNullOrWhiteSpace(destination) Then
ShowStatus(IconWarning & " Source or destination path is invalid.")
Return
End If
' If source and destination are the same, do nothing
If String.Equals(source.TrimEnd("\"c), destination.TrimEnd("\"c), StringComparison.OrdinalIgnoreCase) Then
ShowStatus(IconWarning & " Source and destination paths are the same. Move operation canceled.")
Return
End If
' Is source on the protected paths list?
If IsProtectedPathOrFolder(source) Then
ShowStatus(IconProtect & " Move operation prevented for protected path: " & source)
Return
End If
' Is destination on the protected paths list?
If IsProtectedPathOrFolder(destination) Then
ShowStatus(IconProtect & " Move operation prevented for protected path: " & destination)
Return
End If
' Prevent moving a directory into itself or its subdirectory
If Directory.Exists(source) AndAlso
(String.Equals(source.TrimEnd("\"c), destination.TrimEnd("\"c), StringComparison.OrdinalIgnoreCase) OrElse
destination.StartsWith(source.TrimEnd("\"c) & "\", StringComparison.OrdinalIgnoreCase)) Then
ShowStatus(IconWarning & " Cannot move a directory into itself or its subdirectory.")
Return
End If
' Check if the source is a file
If File.Exists(source) Then
' Check if the destination file already exists
If Not File.Exists(destination) Then
' Navigate to the directory of the source file
NavigateTo(Path.GetDirectoryName(source))
ShowStatus(IconDialog & " Moving file to: " & destination)
' Ensure destination directory exists
Directory.CreateDirectory(Path.GetDirectoryName(destination))
File.Move(source, destination)
' Navigate to the destination folder
NavigateTo(Path.GetDirectoryName(destination))
ShowStatus(IconSuccess & " Moved file to: " & destination)
Else
ShowStatus(IconWarning & " Destination file already exists.")
End If
ElseIf Directory.Exists(source) Then
' Check if the destination directory already exists
If Not Directory.Exists(destination) Then
' Navigate to the directory being moved so the user can see it
NavigateTo(source)
ShowStatus(IconDialog & " Moving directory to: " & destination)
' Ensure destination parent exists
Directory.CreateDirectory(Path.GetDirectoryName(destination))
' Perform the move
Directory.Move(source, destination)
' Navigate to the new location FIRST
NavigateTo(destination)
' Now refresh the tree roots
InitTreeRoots()
ShowStatus(IconSuccess & " Moved directory to: " & destination)
Else
ShowStatus(IconWarning & " Destination directory already exists.")
End If
Else
ShowStatus(IconWarning & " Move failed: Source path not found. Paths with spaces must be enclosed in quotes. Example: move ""C:\folder A"" ""C:\folder B""")
End If
Catch ex As Exception
ShowStatus(IconError & " Move failed: " & ex.Message)
Debug.WriteLine("MoveFileOrDirectory Error: " & ex.Message)
End Try
End SubRejects empty or whitespace paths to prevent confusing errors.
If the source and destination resolve to the same location, the move is canceled.
Both source and destination are checked against a protected‑paths list.
Protected paths cannot be moved.
The method prevents moving a directory into:
- Itself
- One of its own subdirectories
This avoids catastrophic recursive behavior.
If the source is a file:
- Navigate to the file’s directory
- Ensure the destination directory exists
- Move the file
- Navigate to the destination folder
- Show success
If the source is a directory:
- Navigate into the directory being moved
- Ensure the destination parent exists
- Move the directory
- Navigate to the new location
- Refresh the tree
- Show success
Any exception results in:
- A user‑friendly status message
- A debug log entry
This method is built around clarity, safety, and emotional transparency:
- The user always sees what is about to happen
- The user always sees the result
- Dangerous operations are prevented
- All actions are narrated through status messages
- The UI updates in a way that reinforces the mental model
This makes the file manager not just functional — but guiding.
The File Explorer supports a set of convenient keyboard shortcuts to speed up navigation and file operations. These shortcuts mirror familiar behaviors from traditional file managers, making the interface fast and intuitive.
| Shortcut | Action |
|---|---|
| Alt + ← (or Backspace) | Go back to the previous folder |
| Alt + → | Go forward to the next folder |
| Alt + ↑ | Move up one level (parent directory) |
| Ctrl + L (or Alt + D, F4) | Focus/select the address bar |
| F11 | Toggle full‑screen mode |
| Shortcut | Action |
|---|---|
| F2 | Rename the selected file or folder |
| Ctrl + Shift + N | Create a new folder |
| Ctrl + Shift + T | Create a new text file |
| Ctrl + O | Open the selected file or folder or start an open command |
| Ctrl + C | Copy selected items |
| Ctrl + V | Paste items |
| Ctrl + X | Cut selected items |
| Ctrl + A | Select all items |
| Ctrl + Shift + E | Expand the selected folder or drive |
| Ctrl + Shift + C | Collapse the selected folder or drive |
| Ctrl + D (or Delete) | Delete selected item to the Recycle Bin |
| Shortcut | Action |
|---|---|
| F3 (or Ctrl + F) | Start a search in the current folder |
| F5 | Refresh the current folder view |
This project is licensed under the MIT License. You are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, with the inclusion of the copyright notice and permission notice in all copies or substantial portions of the software.
To install and run the File Explorer application:
- Clone the repository:
git clone https://github.com/JoeLumbley/File-Explorer.git
- Open the solution in Visual Studio.
- Build the project and run it.
- Launch the application to access your file system.
- Use the tree view on the left to navigate through folders.
- The list view on the right displays the contents of the selected directory.
- Use the text box to enter commands or navigate directly to a path.
- Right-click on files or folders for additional options.
This project is inspired by traditional file explorers and aims to provide a simplified experience for managing files on Windows systems.
For more details, check the source code and documentation within the repository.