stiv Posted February 15, 2024 Posted February 15, 2024 (edited) Hello all of you, I have a problem, what happens is that I want to execute BlockInput in my code, since when I carry out a scheduled process it does not work for me unless I execute it as administrator by clicking manually. I would like to know if there is any way to include the administrator user with the password in the code so that it runs with elevated permissions. I tried to use runes, but it doesn't do anything or I don't know if the syntax is wrong #include <WinAPI. $usuario = "dominio\administrador" $contrasena = "contraseña" ; Ejecutar AutoIt como administrador RunAs($usuario, "",$contrasena, 0, @AutoItExe & " " & '"' & @ScriptFullPath & '" ') ; Bloquear entrada BlockInput(1) Sleep(15000) BlockInput(0) MsgBox(64, "prueba", "termino la ejecucion") Thank you so much Edited February 15, 2024 by stiv
argumentum Posted February 15, 2024 Posted February 15, 2024 (edited) Congratulations in you 35th post since 2021 ! Is good to see that you learned about font size and code posting. Edited February 15, 2024 by argumentum SOLVE-SMART and Andreik 2 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
stiv Posted February 15, 2024 Author Posted February 15, 2024 @argumentum thanks for the corrections to my syntax argumentum 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now