Tag portability

[Solved] Running Program from USB drive [closed]

You can get the executing assembly path. string path = (new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath; From there, you can obtain the drive letter (path root): string drive = Path.GetPathRoot(path); If your file is in the same directory as the executable, you can get…