I am trying to use Redmon http://www.winimage.com/misc/redmon/ to send print jobs to a C # user application. Redmon “launches” (in fact, the print spooler) as SYSTEM, but has the ability to run as a user so that your application runs under the user who printed the job. The problem is that it does not load the user environment. Therefore, calling functions such as Path.GetTempPath () point to \ windows \ temp instead of the user. Also, when trying to start Outlook 2007+ through MAPI calls (to add attachments), it reports form errors due to, in my opinion, the location of the temp folder.
Is there a way to "reload" the profile, or at least get your environments within the Impersonated application? The only ideas I have had so far is to rebuild vars directly from the registry, but I want to avoid this as it is hacking (avoiding implementation details and all that). Or make a stub program that Redmon calls and then properly runs the user application as a user with a full profile.
Any other items or tricks?
source
share