I'm going to have an ASP.NET MVC application that will run on many clients, all of which have their own local version of IIS running. I'm trying to open a PowerPoint file with Process.Start(). The PowerPoint is successfully opening (I can see it in Task Manager) but it is running in the background and I would like it to open in the foreground.
In order to start the application I'm using the following code:
string powerPointPath = @"C:\Program Files (x86)\Microsoft Office\root\Office16\POWERPNT.EXE";
string powerPointFilePath = "\"" + filePath;
Process powerPoint = new Process();
powerPoint.StartInfo.FileName = powerPointPath;
powerPoint.StartInfo.Arguments = " /S " + filePath;
powerPoint.Start();
Since I'm using a local instance of IIS, I made sure to grant read permissions for the PowerPoint executable to the IIS APPPOOL\DefaultAppPool
user. Is there any way to ensure that PowerPoint runs in the foreground?
Edit: I'm able to run this code without an issue when using IIS Express in Visual Studio (in which case the application is using the MYNAME\myname
user permissions) but it does not seem to work equivalently when using Local IIS (i.e. when the application is using the IIS APPPOOL\DefaultAppPool
user).