-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] Black screen when used from Task scheduler (+fix) #149
Comments
I found now that someone reported the same here Does exist any solution to this ? |
Hello, If you use the "Run only when user is logged on" option in the task, does it work? |
No it does not work too. SolutionHowever I found the solution, and the solution is executing it using |
Ah, great news, thanks for the fix :) And if I may, you could rewrite your code to something like that (using MSS.shot()): import mss
import time
count = 0
with mss.mss() as sct:
sct.compression_level = -1
while "screenshotting":
file_path = sct.shot(output="d:/screen/work/{date:%Y%m%d-%H%M%S}.png")
count += 1
print(file_path)
time.sleep(10) |
I have the same problem. My code is very simple:
I'm using the "Start a program action" in the task scheduler, with the following parameters:
It doesn't work even when I'm logged on or if I trigger the task manually. Interestingly, I can open a PowerShell from the desktop, run the exact command in the task ( @BoboTiG please let me know if you rather have a new issue for this. |
General information:
Description of the warning/error
I'm using this Python code to generate a Windows 10 desktop screenshot every 10 seconds
and save it in d:/screen/work/ folder. It works very well and extremely fast .
I execute the code from Windows command prompt (cmd.exe)
python d:/screeen/screen.py
The problem starts when I try to automatize the script. I want the script starts automatically when I turn on the computer and I loggin in and I do not want the command window appears.
I followed this guide https://www.howtogeek.com/tips/how-to-run-a-scheduled-task-without-a-command-window-appearing/
When I login in computer the Pyhton script starts correctly , no command window appears,
but in my d:/screen/work/ folder are saved only full black screenshots !
How to avoid this ?
Thank you
The text was updated successfully, but these errors were encountered: