Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro function to unlock computer but run in background
#1
For my Siri Remote Control (https://www.quickmacros.com/forum/showth...p?tid=7062) to work properly,
I need to be able to start QM and Python before the user login.

I already googled a lot but can't get this part to work, except when I log off after being logged in so all the programs already run.
Some suggested to use the system Autostart folder which I did, but it seems to start the programs after login and not before.
Maybe its only Python that doesnt want to start, because QM is a Service and as far as i know they should start before logging in?
I also used Task Scheduler to start the Programs on System Start but that also didnt solve the problem.

Can i somehow let QM start Python after booting and in the login screen?
If so it would be super cool if someone can tell me how.
Please also tell me how to start a specific python script directly after launching pyhton.
And do you think i need the cmd to be started too if i launch a .bat with that python script?
Big Grin

(Python reads my Gmail Notes and then trigger .bat files who launches the macros)
I hope to explain it good enough. All that should happen before the first user logs in after booting.

The actual problem with QM is, that my login macro should send a message via telegram when logged in.
Code:
Copy      Help
out "start"
opt slowkeys 1; spe 100
key (44)        ;; DRUCK
opt slowkeys 0
run "C:\Users\username\AppData\Roaming\Telegram Desktop\Telegram.exe"
wait 5
key Z           ;; ESC
wait 0.2
key telechannel     ;; H 2 6 4 G UMSCHALT+O
wait 0.2
key D           ;; NACH-UNTEN
wait 0.2
key Y           ;; EINGABE
wait 0.2
key loggedVinY  ;; L O G G E D LEER I N EINGABE
wait 0.2
min "Telegram"
end

I guess, for this to work as intended i would need this "Macro unlock Windows" function to behave different.

   

If I choose "If computer locked" it doesn't allow me to run the macro in Background. It always activates "Don't run in background" too.
That means if the log in via macro was successful, it stops the macro because of that and doesn't finish the task to say hello in telegram.
Probably there is an easy way to fix this with a second macro or so, but I don't know how to set it up.


When logged in, the Remotecontrol with Siri works pretty well and its super useful. I can only recommend to try it yourself!
#2
QM cannot start (or run normally if started) before the user login. But exe-macros can. Create an exe-macro and let Task Scheduler run the exe file on System Start. Let the macro start Python etc. But it cannot log in (enter password etc). If computer is locked, QM can unlock.
#3
Thank you for answering.

So this means i need an .exe Macro to start Python and my python script that listens for the command to login. Then the python script launches the bat who starts the normal QM macro that logs in?
#4
Quote:if the log in via macro was successful
Quote:starts the normal QM macro that logs in

A macro cannot log in. As well as any normal program.
#5
Ok now i understand the difference between unlock and login.

Can you please tell my why (when trying to lock) the Win key is not working?

It always sends an L but not Win+L as it seems. I even tried this:
Code:
Copy      Help
 log off
key+ Wl         ;; Win+L
wait 0.1
 waited
key- Wl         ;; Win+L
wait 0.1
 logged off
end

Seems there is a workaround to start macros before login. Do you think this could work?
(Replacing the Ease of Access feature with QM) https://www.intowindows.com/how-to-run-a...in-screen/

Edit: I guess the problem is, that one needs to click on the ease of access button in login screen. xD


Edit2: I also tried Wl or the VK Keycode method with and without press and release. Nothing seems to work and it always just sends the L
#6
Windows does not allow to send Win+L, Ctrl+Alt+Del, maybe some other hotkeys.
To lock:

shutdown 6

-------
 
Quote:Edit: I guess the problem is, that one needs to click on the ease of access button in login screen.
Yes.
#7
Thank you. The shutdown 6 really helped a lot!

I found another problem when unlocking. I do not use Ctrl Alt Del before unlocking but i use

Z (PASSWORD) Y

I was thinking it translates to Esc PASSWORD Enter and it seems it does but...

i need to launch the unlock macro twice because the first time it only reveals the password field without typing in the password.
What could be the reason?
#8
Need some time after Esc.

Z (1.5) (PASSWORD) Y
#9
Thank you. I dont know why, but it didnt help. Maybe i found a bug...

I even tried Z (2) Z (2) (PASSWORD) Y and nothing happened. I triggered the macro a few times.
The password form wasnt revealed but my macro (only one out start to know it was running) ran a few times.

Output:
start
start
start

When revealing the password form manually by pressing ESC the macro works.
When using only one Z (2) and triggering the macro twice it works too.

Is there another way to make it reliably working by only triggering the macro once?
#10
Should be (2.0), not (2).

Or try to create an exe-macro that would unlock computer (sends keys etc) and let it run while unlocking (set it in dialog "Unlock computer"). More info and example in help topic "Unlock computer".


Forum Jump:


Users browsing this thread: 1 Guest(s)