8 Replies - 1101 Views - Last Post: 30 October 2020 - 10:16 AM Rate Topic: -----

#1 WillieWortel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-March 09

EXE only runs with admin right

Posted 22 October 2020 - 06:56 AM

Good afternoon,

I made a program (exe) but this program only works if I have administrator rights. How can I solve this?

Best regards
Is This A Good Question/Topic? 0
  • +

Replies To: EXE only runs with admin right

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15965
  • View blog
  • Posts: 63,898
  • Joined: 12-June 08

Re: EXE only runs with admin right

Posted 22 October 2020 - 07:15 AM

What is this exe doing?
Was This Post Helpful? 0
  • +
  • -

#3 WillieWortel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-March 09

Re: EXE only runs with admin right

Posted 22 October 2020 - 07:22 AM

View Postmodi123_1, on 22 October 2020 - 08:15 AM, said:

What is this exe doing?


it can read and write xml and excel files
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15965
  • View blog
  • Posts: 63,898
  • Joined: 12-June 08

Re: EXE only runs with admin right

Posted 22 October 2020 - 07:45 AM

You can either have it run as admin from the EXE (right click->properties->compatability) or muck with the solution's manifest in the "requestedexecutionlevel" area.
Was This Post Helpful? 0
  • +
  • -

#5 WillieWortel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-March 09

Re: EXE only runs with admin right

Posted 26 October 2020 - 08:12 AM

View Postmodi123_1, on 22 October 2020 - 08:45 AM, said:

You can either have it run as admin from the EXE (right click->properties->compatability) or muck with the solution's manifest in the "requestedexecutionlevel" area.


View PostWillieWortel, on 26 October 2020 - 09:10 AM, said:

View Postmodi123_1, on 22 October 2020 - 08:45 AM, said:

You can either have it run as admin from the EXE (right click->properties->compatability) or muck with the solution's manifest in the "requestedexecutionlevel" area.





That's the strange thing run as admin (right mouse button) doesn't work. I really need to be a member of the administrators group.

the manifest states the following:
<!-- UAC Manifest Options
            If you want to change the Windows User Account Control level replace the 
            requestedExecutionLevel node with one of the following.

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

            If you want to utilize File and Registry Virtualization for backward 
            compatibility then delete the requestedExecutionLevel node.
        -->




Was This Post Helpful? 0
  • +
  • -

#6 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 76
  • View blog
  • Posts: 434
  • Joined: 07-May 15

Re: EXE only runs with admin right

Posted 26 October 2020 - 08:26 PM

There are things that all users can do, like guests, and there are things that users with privileges can do.
So, first you need to locate in your code what commands you call that cannot be executed with normal user/guest privileges.
For example, if you read registry keys, guests can do it, if you wanna edit registry keys, administrator privileges are required and UAC are triggered. Another example, if you wanna write a file to the desktop, all users and guests can do it, if you wanna write a file to some special folder, like system32, administrator privileges are needed.
When you locate your code that requires administrator to run it, if its not so important with path, you can modify it, to make it running with minimal requirements. If indeed your application are doing something that are specific, and that needs administrator requirements, if its the only way, keep it, and then manifests come into the play, where you can describe your application needs to the operating system.
By default, system will launch your application as invoker and observer when higher requirements are needed, thats basically same as guest privileges. If your application require administrator requirements to work, you can mark it right away, and on each application launching system UAC will ask for administrator control, owner and user password if they exist. Putting on highest available as many programmers do makes your system to launch your appication with highest privileges available, instead of guest, it will launch as a user with at least some control, if thats not enough for application to work, it will trigger UAC for higher privileges.
UAC is a part of security introduced since Longhorn/Vista, to protect users from launching potentially dangerous applications with highest privileges, giving opportunity for a malicious code to do its job with highest possible privileges. You can disable UAC on the system, and thats putting you in potentially dangerous zone where you can launch something dangerous without been warned. Another way to avoid UAC are to put your digital signature on your application, it has time limit, like for how long your signature are valid, when expired, you need newer one, with updates, or extended one as a patch for older, and it comes with a price, and companies that approve your signature such as Microsoft, Google, Comodo, etc. (who have their long roots in many operating systems and web browsers, so dont think about starting your own company for signatures, because you will need a contracts with the most biggest companies in IT) require your personal data/information, that can be used in future to protect your code legally or to get you arrested if your code are malicious/illegal. The basic one will prevent your application from been blocked by web browser downloading, maybe UAC, something better will allow your application much more options, while extended one are the most expensive and only the long time deal for big projects. For the beginning, peoples usually create self-signed digital certificate/signature to use it before they complete the project, when the real signature will be applied. You can also create your fake signature, sign it to your system, manage it in system database, and use it on your application, but it will only work on your machine, since other accounts and machines does not have your signature in their database as the valid, trusted and safe one, means self-signed are much easier to use for testing purposes.
The real signature on application are marked in the system as the trusted one, as a trusted file, and it cannot be blocked by web-browser, by the system, antivirus or firewall, application with certificate got all doors open, its like a golden card to do whatever you wanna do. For example, many gaming companies use certificates on the games, but not to protect single .exe file from been cracked, but because it allows them to collect your data, like crashs, hardware information, your previously used habits in the game, send it to the server and many more things, sometimes touching system32 or other sensiteve things, whithout worrying about any kind of protection, because their application has the golden card to do whatever they want and to go anywhere without any kind of restriction (also means no UAC), but it has to be by the law, like no virus.

Edit: If you are going for signature, even the cheapest coder sgnatures (that protects your code as it belongs to you, UAC will be triggered, but at least web-browsers/antiviruses/firewalls will not block it) are not so cheap for some countries. Peoples who make some utilities applications for system administrators in most chases dont have money for the best signature to suit them, for applications that touch sensitive things, and its common today to get PUA/PUP (Potentially Unwanted Application/Program) trigger by most security that exists like antiviruses (because they detect that application touch something sensitive, but malicious thing that may exist in the code are not detected/known), and usually system administrators who use various of utilities pretty much know what that application does, but its probably good to have at least some valid signature, specially for drivers, so even if system asks for administrator privileges it shows at least some signature, owner, company, that leads useres mostly to approve it, if eg. driver does not have signature, system will mostly block it right away, but even if it asks for permissions, users are most likely to cancel it if there are no information about the publisher.

This post has been edited by Radius Nightly: 26 October 2020 - 09:00 PM

Was This Post Helpful? 0
  • +
  • -

#7 WillieWortel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-March 09

Re: EXE only runs with admin right

Posted 27 October 2020 - 12:28 AM

View PostWillieWortel, on 26 October 2020 - 04:12 PM, said:

View Postmodi123_1, on 22 October 2020 - 08:45 AM, said:

You can either have it run as admin from the EXE (right click->properties->compatability) or muck with the solution's manifest in the "requestedexecutionlevel" area.


View PostWillieWortel, on 26 October 2020 - 09:10 AM, said:

View Postmodi123_1, on 22 October 2020 - 08:45 AM, said:

You can either have it run as admin from the EXE (right click->properties->compatability) or muck with the solution's manifest in the "requestedexecutionlevel" area.





That's the strange thing run as admin (right mouse button) doesn't work. I really need to be a member of the administrators group.

the manifest states the following:
<!-- UAC Manifest Options
            If you want to change the Windows User Account Control level replace the 
            requestedExecutionLevel node with one of the following.

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

            If you want to utilize File and Registry Virtualization for backward 
            compatibility then delete the requestedExecutionLevel node.
        -->
 <requestedExecutionLevel level="asInvoker" uiAccess="false" />




Was This Post Helpful? 0
  • +
  • -

#8 WillieWortel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-March 09

Re: EXE only runs with admin right

Posted 29 October 2020 - 05:36 AM

ok thanks a lot for the information i am going to look at it

This post has been edited by IronRazer: 30 October 2020 - 10:11 AM
Reason for edit:: Removed Large Quote

Was This Post Helpful? 0
  • +
  • -

#9 IronRazer   User is offline

  • Custom Control Freak
  • member icon

Reputation: 1544
  • View blog
  • Posts: 3,871
  • Joined: 01-February 13

Re: EXE only runs with admin right

Posted 30 October 2020 - 10:16 AM

@ WillieWortel,
Please use the Fast Reply box at the bottom of the page to reply instead of the Quote button on the bottom of the posts. Thanks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1