RunApplication with runappflag.noelevation

Bug reports.
User avatar
doke
Posts: 73
Joined: Fri Mar 29, 2019 2:33 pm

RunApplication with runappflag.noelevation

Post by doke » Tue Sep 20, 2022 11:05 am

Hi,

When running code below for following 2 scenarios,
A - running ranorex as admin
B - running ranorex as normal user ) :
 Runappstatus = ValueConverter.ToString(Host.Local.RunApplication("C:\\ProgramData\\Notepad++\\Notepad++.exe", "", "", false,RunAppFlags.None));
            Report.Log(ReportLevel.Info, "Application", "Run application powershell WITH RunAppFlags.None       . Runappstatus ="+Runappstatus  );
            //Delay.Duration(60000, false);
            Runappstatus = ValueConverter.ToString(Host.Local.RunApplication("C:\\ProgramData\\Notepad++\\Notepad++.exe" , "", "", false,RunAppFlags.NoElevation)); // A+B issue 1.  When the delay is added it works as expected.
            Report.Log(ReportLevel.Info, "Application", "Run application powershell WITH RunAppFlags.NoElevation. Runappstatus ="+Runappstatus  );
            //Delay.Duration(60000, false);
         	Runappstatus = ValueConverter.ToString(Host.Local.RunApplication("C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "-Noexit -Command get-process;read-host", "", false,RunAppFlags.None));
            Report.Log(ReportLevel.Info, "Application", "Run application powershell WITH RunAppFlags.None       . Runappstatus ="+Runappstatus  );
        	//Delay.Duration(60000, false);
            Runappstatus = ValueConverter.ToString(Host.Local.RunApplication("C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "-Noexit -Command get-process;read-host", "", false,RunAppFlags.NoElevation));
            Report.Log(ReportLevel.Info, "Application", "Run application powershell WITH RunAppFlags.NoElevation. Runappstatus ="+Runappstatus  );
            Delay.Duration(60000, false);  // B issue 1 // A+B  issue 2
I'm having 2 issues:

1-Timing issue: looks like when (same) call is done twice shortly after eachother, the second call is not executed.
2-Gui issue with powershell : no output to screen, looks like -Noexit parameter is overrided

Is anyone able to reproduce this ?