Created
April 6, 2023 14:25
C# code written in a hurry to navigate directories on the basis of wildcards :D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
namespace listfiles | |
{ | |
public static class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
if (args.Length == 0) { | |
Console.WriteLine("Usage: listfiles.exe <basepath> <wildcard-path>\nEg: listfiles.exe C:\\ vorf*"); | |
} else { | |
Console.WriteLine("[+] Changing to " + args[0] + args[1] + "\n"); | |
foreach (string directory in Directory.GetDirectories(args[0], args[1])) // "C:\\", "vorf*" | |
{ | |
Directory.SetCurrentDirectory(directory); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment