I created a right click shortcut entry (in Explorer's right click context menu) for my application, and I want to get the folder or file path on which right click is done? my registry entry is HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\copy path2\command where command = "C:\Users\Atrix\Desktop\ConsoleApplication1.exe"; my c# code....
string fileName = "myfile.ext"; string fullPath; fullPath = Path.GetFullPath(fileName); //and I m trying to save the path to txt file. string log = fullPath; string filePath = @"C:\Users\Atrix\Desktop\log.txt"; FileStream myLog = new FileStream(filePath,FileMode.Append ,FileAccess.Write); StreamWriter sw = new StreamWriter(myLog); sw.Write(log); sw.Close(); myLog.Close();