.NET runas with starter.exe and elevated.exe

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
jwest_bNvo
Posts: 3
Joined: Tue Oct 09, 2018 1:38 am

.NET runas with starter.exe and elevated.exe

Post by jwest_bNvo » Tue Oct 09, 2018 5:52 am

Hello Guys,

Powershell Studio 2018 Version 5.5.154 x64
Windows 10 1709 x64

Related to
https://www.sapien.com/forums/viewtopic.php?f=12&t=12728

I got the same Bug and the Problem persists and looks like this:
.net-RUNAS.png
.net-RUNAS.png (4.58 KiB) Viewed 670 times
So how can we solve this problem as its not working as designed!?

If this is a .NET Bug this should be reported to the .NET Developers.
Even if I switch the Packager from .NET 4.5 to .NET 2.0 it does not work.

So maybe there is a problem with the implementation in the packager/Powershell Studio?

A VBA can't be the solution.

User avatar
Alexander Riedel
Posts: 6684
Joined: Tue May 29, 2007 4:43 pm

Re: .NET runas with starter.exe and elevated.exe

Post by Alexander Riedel » Tue Oct 09, 2018 7:01 am

It is a .NET problem. It can easily be demonstrated with two C# applications created with Visual Studio.
Microsoft has of course been informed.

If you switch the packager to a different PowerShell engine, which changes the .NET requirements, it will still use whatever framework you have installed.
Including the parts that cause this problem. That is just how .NET works.

"A VBA can't be the solution." I am not sure what that means. The solution is to use a starter that is not a .NET application. Our packager can make a VBScript into an exe, which happens to be C++ based.
You can of course use whatever else you like, but the general solution is to use anything that calls ShellExecute as shown in the VBS example.
Alexander Riedel
SAPIEN Technologies, Inc.

jwest_bNvo
Posts: 3
Joined: Tue Oct 09, 2018 1:38 am

Re: .NET runas with starter.exe and elevated.exe

Post by jwest_bNvo » Tue Oct 09, 2018 8:04 am

I thought at first I have to provide the credentials inside the VBA/VBS so it is in plaintext == no solution for me.

How can I Package the vbs so it suits my case?

When I open a vbs with the code you provided in the other thread. I cant Package the File to an .exe.
Maybe you can explain a bit further. How to proceed exactly.

thanks in advance

jwest_bNvo
Posts: 3
Joined: Tue Oct 09, 2018 1:38 am

Re: .NET runas with starter.exe and elevated.exe

Post by jwest_bNvo » Thu Oct 11, 2018 6:56 am

For alle People running into this issue and just want to open a program as admin under user rights.

User the "local administrator" by means = the original Administrator which is automatically added on each system by windows. (most times disabled)