C#:
public static void USBSearcher()
{
Console.Write("Add Path: ");
string PATH = Console.ReadLine();
while (true)
{
Thread.Sleep(2000);
foreach (var dInfo in DriveInfo.GetDrives())
{
if (dInfo.IsReady && dInfo.DriveType == DriveType.Removable)
{
Console.WriteLine(dInfo);
string USBPath = dInfo.ToString();
try
{
string outFile = Path.Combine(dInfo.RootDirectory.ToString(), PATH);
File.Move(PATH, outFile);
Console.WriteLine("Yes");
}
catch
{
Console.WriteLine("No");
}
}
else
{
Console.WriteLine("No");
continue;
}
}
}
}