I’m using the ShellRunAs tool to launch a .NET application. This .NET applicaiton makes use of an application configuration file.
When I attempt to run the application via ShellRunAs, regardless of the credentials I use, the application appears to be unable to find its configuration file.
I used Process Monitor to see the failed file access, and it looks like using ShellRunAs is somehow causing .NET to look for an appreviated EXE.config path rather than the full EXE.config path.
For instance, when I launch my app normally, I see successfull reads of
c:\program files (x86)\my company\my
product\MyLongApplicationName.exe.config
But when I launch via ShellRunAs, I see “NAME NOT FOUND” entries for:
c:\program files (x86)\my company\my product\MyLong~1.exe.config
Am I missing something here? Is there a way to solve this problem?
This appears to be a bug in ShellRunAs and the usage of the GetShortPathName Win32 API.
Details here: http://forum.sysinternals.com/83-style-paths-for-modules-when-using-shellrunas_topic16246.html
Unfortunately, my only work around is to have a copy of the exe.config file with an 8.3 naming scheme.
Modifying the NTFS registry setting had no affect.