Results 1 to 8 of 8

Thread: [RESOLVED] Windows UAC stops code execution ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2018
    Posts
    80

    Resolved [RESOLVED] Windows UAC stops code execution ?

    Had this problem come up when making a client/server app (using tcp and sockets).

    The server sends data to the client every 15 secs.

    When the UAC prompt shows up on the client side it stops receiving data until you either
    accepted or canceled the said prompt.

    I could go around UAC but I'm looking for a clean solution if there is one.

    Thanks,

    KBConsole

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Windows UAC stops code execution ?

    You know how to bypass UAC which no programmer would do unless up to no good but can't find a solution? Considering if we think on the innocent side you have not provided us with any code or an explanation what you are doing.

    The clean solution is to obtain admin rights.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2018
    Posts
    80

    Re: Windows UAC stops code execution ?

    I have admin rights but still get the "yes/no" prompt, which interrupts the program.

    Said program being a remote mouse, in a way.
    It's actually checking for the darkest area on the client screen and moves the mouse towards it.
    Used for testing dark spots on screens since it looks at a white image.

    Using the windows API to move the mouse and 2 timers I figured the mouse API may be the part that is blocked by the prompt ?

    PS: I could bypass it and since we are in a testing environment I wouldn't risk much but it's not something I'd like to do.
    Last edited by KBConsole; Jun 26th, 2018 at 08:24 PM.

  4. #4
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

    Re: Windows UAC stops code execution ?

    When you run your program, do "Run as Admin"? If not, try that.

  5. #5
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Windows UAC stops code execution ?

    Being admin is not the same as XP. Application rights are bassed on tokens. Change the applications manifest to requireAdministrator.

    https://msdn.microsoft.com/en-us/library/bb384691.aspx

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2018
    Posts
    80

    Re: Windows UAC stops code execution ?

    I had already tried that but it doesn't change anything.
    I believe the "uiAccess" setting would fix my problem if set to true but I have no certificate.
    It requires a MS certified app to use that setting.

    I fixed it by editing the reg key for auto-accepting prompts from admin accounts on form load and change it back on exit.
    A better option might exist but this fits nicely for the job so it'll do for now.

    Thanks for the help,

    KBConsole

  7. #7
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: [RESOLVED] Windows UAC stops code execution ?

    because that doesn't seem nefarious at all...

    you don't need a cert to set level=requireAdministrator
    This puts the UAC prompt at the start of the app, and voila - no interruption.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jun 2018
    Posts
    80

    Re: [RESOLVED] Windows UAC stops code execution ?

    Quote Originally Posted by DEXWERX View Post
    because that doesn't seem nefarious at all...

    you don't need a cert to set level=requireAdministrator
    This puts the UAC prompt at the start of the app, and voila - no interruption.
    I'll admit this may look suspicious but it's pretty much supposed to (due to the job it does), here's why:

    The place I currently work at refurbishes laptops.
    This involves a lot of testing which we have many different programs for. (Some not being made by me)
    The software I was working on is running all needed programs remotely (From our local server).
    Some of said programs need admin rights (and even when on an admin session that give you a "yes/no" prompt).

    Since this is the same structure as many malware (remote connection, data retrieval, distant program execution,etc...)
    I chose not to post any code example of it since it could rather easily be tempered with and converted for improper IT usage.

    This being said elevating my program wouldn't have worked.

    Sincerely,

    KBConsole

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width