Jump to content

#RequireAdmin---something is wrong with use


 Share

Recommended Posts

1 hour ago, JockoDundee said:

I looked, but I didn’t find your actual regedit there.

All I saw was a msgbox program that you said to add to my boot up.

Can I use task scheduler with elevated admin?

If not, shouldn’t I use your regedit string?

You can compile my sample code and join the startup items, you will understand, it will not execute.

and You can use two ways to join it to boot startup.

 

1. C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\

2. RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", @ScriptName, "REG_SZ", @ScriptFullPath)

Edited by meety
Link to comment
Share on other sites

55 minutes ago, caramen said:

If you mean that your issue isn't to run the program at startup but run the program at startup with admin right. 

 

Here also you got multiples ways. The best way for this is task scheduler yeah. 

But you could also use one of my precedent suggestion with one additional step. 

image.png.e83423a7d8dfe38d3dec78a98ebcbab8.png

Right click > Property > compatibility > change parameter > Execute as admin. 

Also, it can prompt you with UAC. If you want to disable UAC prompt.

You can do it with registry or windows interface.  

 

thank you!

Link to comment
Share on other sites

Could we have the correct question ? 😅

 

21 hours ago, meety said:

thank you!

For us, or at least for me, that mean your issue was solved.

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Developers
6 hours ago, meety said:

Can I get the correct answer?

Which part in all the replies you receive were not correct? You realize this is not the smartest reply when people are trying to help you ...right?
So what about you tell us what you think should happen when you want to run an script at startup with #RequiryAdmin first. What is your expectation?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

1 hour ago, Jos said:

Which part in all the replies you receive were not correct? You realize this is not the smartest reply when people are trying to help you ...right?
So what about you tell us what you think should happen when you want to run an script at startup with #RequiryAdmin first. What is your expectation?

Jos

Hi,Jos 

Nice to meet you!

I have gave up because people didn't seem to understand my question, although I had explained it very clearly.

Edited by meety
Link to comment
Share on other sites

1 hour ago, Jos said:

Which part in all the replies you receive were not correct? You realize this is not the smartest reply when people are trying to help you ...right?
So what about you tell us what you think should happen when you want to run an script at startup with #RequiryAdmin first. What is your expectation?

Jos

I say that I found that after using the #RequireAdmin function, after the script is compiled, add it to the system startup items. the program cannot be executed after system boot up.

Can you understand what I mean?

Link to comment
Share on other sites

Look, you have to do one thing. Just watch my signature. 

" How to ask help " 

 

Just, show us....

Copy past your entire script here. Not only one part. 

 

Cannot be executed ?

Why ?

How ?

What is the problem ?

UAC ?

Not running at all ? 

You got error message ? 

Any screenshot that can help maybe ?

 

We don't have crystal ball skills here. 

 

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

I believe people who know the cause of the problem don’t need to ask other things.

Because I've made it very clear, and I've given the sample code. After you compile it and add it to the system startup items, you can reproduce the problem If you have questions about this. But it's clear that people didn't do it, and people thought I didn't give the real code. So they won't know the cause of the problem.

Edited by meety
Link to comment
Share on other sites

On 4/29/2021 at 4:50 AM, meety said:

What is the difference? UAC is closed.

What does that mean? It’s off? It’s hard to understand you because you’re not using correct terms and you won’t post your code and you’re being very secretive about what it is you’re doing so people aren’t going to help you

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

@meety.  You cannot run directly from startup folder a program that #RequireAdmin.  But you can ShellExecute a second script that includes #RequireAdmin.

Script 1 (must be compiled and copied into startup folder)

ShellExecute("c:\apps\autoit\TempExtra.au3")

Script 2 (uncompiled, called here as TempExtra.au3)

#RequireAdmin
MsgBox(0,"","test")

Working fine for me on Win7. 

ps. you may also need to exclude startup folder from your AV scan (or use a shortcut instead of having the exe physically there)

Edited by Nine
Link to comment
Share on other sites

I've never used it, I like my program to be able to run anywhere.
1.If there is no need for windows interaction, for example my monitoring program will run as a service on system user.
2. For the application that needs admin rights I use  Task scheduler to set it up
3. The rest will use the reg key.

Regards,
 

Link to comment
Share on other sites

i didnt read any comment here. But to my knowledge windows just doesnt startup any .exe that requires admin. Dont use #RequireAdmin, as windows will just ignore the app then on startup (thats only true to registry startups). You should invoke the UAC prompt on your own.

Take this as an example

_MakeMeAdmin()

Func _MakeMeAdmin()
    if Not IsAdmin() Then
        Local $oShell = ObjCreate("Shell.Application")
        $oShell.ShellExecute(@AutoItExe, @ScriptFullPath, '', 'runas')
        Exit
    EndIf
EndFunc

MsgBox(0, "", "Im Admin")

 

Link to comment
Share on other sites

I have seen this issue many times. It stems from the fact that disabling UAC stops the prompts for Admin credentials.
This fact leads that user to believe that they have full Admin credentials, and they do not.
Enabling UAC back to its 'Default' setting will cure your headaches.

This advice may not fix your current issue,
but the headaches will slowly subside while you learn to work with Windows instead of against it.

There is NO credible statement from Microsoft stating that disabling UAC elevates that user to have Full Administrative privileges.
Best available information from Microsoft

Edited by Shark007
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...