1

Simple code:

 ProcessStartInfo psi = new ProcessStartInfo(path);
 psi.UseShellExecute = false;
 Process.Start(psi);

if path = C:\Users\Marat\AppData\Local\MyCompany\Program.exe, it's OK!

but if path = C:\Users\Marat\Local Settings\Application Data\MyCompany\Program.exe

getting Exception:

System.ComponentModel.Win32Exception(0x80004005): An invalid name request was made. The name requested cannot be retrieved at this time

Actually, everything worked fine, but at some moment it began to give this error.

Marat
  • 11
  • 1
  • 1
    Why do you put an executable in a path that's solely for data and settings? – Hinek Aug 20 '12 at 14:48
  • Sorry, I don't understand your question – Marat Aug 20 '12 at 14:54
  • The folder `Local Settings\Application Data` is intended for settings, not for applications. You might consider placing your .exe file somewhere else, but that should not be the reason for your problem, as far as I can see. – Kjartan Aug 20 '12 at 16:46

1 Answers1

1

As far as i can remember the Local Settings folder in Windows 7 it's a link to the AppData folder, mainly used for compatibility with old pre-Windows Vista applications, actually you can't access it directly unless you change the owner of that link (It's System), so that's probably why you're getting this error.

Another cause, could be the white spaces in the name, as you don't show how you construct path or its contents when you start the process.

Rafael
  • 2,827
  • 1
  • 16
  • 17