.NET runas with starter.exe and elevated.exe

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION 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.
This topic is 5 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
jwest_bNvo
Posts: 3
Last visit: Thu Jul 20, 2023 4:15 am

.NET runas with starter.exe and elevated.exe

Post by jwest_bNvo »

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 1648 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: 8488
Last visit: Mon Apr 15, 2024 3:28 pm
Answers: 20
Been upvoted: 37 times

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

Post by Alexander Riedel »

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
Last visit: Thu Jul 20, 2023 4:15 am

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

Post by jwest_bNvo »

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
Last visit: Thu Jul 20, 2023 4:15 am

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

Post by jwest_bNvo »

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)
This topic is 5 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.