简体   繁体   English

如何使 python 脚本在 windows 启动时自动运行?

[英]How to make python script autorun on windows startup?

I have a.python script which I convert to.exe file trough autopy-to-exe command and I would like that coverted.exe file always running, so when computer restarts it automaticly starts.我有一个 .python 脚本,我通过 autopy-to-exe 命令将其转换为 .exe 文件,我希望该 coverted.exe 文件始终运行,因此当计算机重新启动时它会自动启动。

So I want to create in.python script that.所以我想创建 in.python 脚本。 I want to configure it so when somebody downloads.exe file and runs it, that.exe file will be in his startup so next time when he logs in that.exe will be working as well.我想对其进行配置,以便当有人下载 .exe 文件并运行它时,该 .exe 文件将在他的启动中,因此下次他登录时,该 .exe 文件也将正常工作。

The simplest way to accomplish this is by placing it in your Startup directory.完成此操作的最简单方法是将其放在启动目录中。 Windows will launch anything in there when someone signs in. You may also set this to run when any user logs in by using the "All Users" Startup folder. Windows 将在有人登录时启动其中的任何内容。您还可以使用“所有用户”启动文件夹将其设置为在任何用户登录时运行。

This is the filepath for the Startup folder, for your user account:这是启动文件夹的文件路径,用于您的用户帐户:
%appdata%\Microsoft\Windows\Start Menu\Programs\Startup
and you can copy and paste that path right into Windows Explorer's address bar to get there.您可以将该路径复制并粘贴到 Windows Explorer 的地址栏中以到达那里。 Drop in the.exe and it will launch on the next login.放入 .exe,它将在下次登录时启动。

Reference for Startup folder 启动文件夹参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python 脚本在 windows 启动时自动运行 - Python script autorun on windows startup 如何在 Linux 中启动时自动运行 python 脚本 - How to autorun a python script at startup in Linux 从python自动运行python脚本 - Autorun python script from python 自动运行 50 个文件的 Python 脚本 - Autorun Python Script for 50 files 如何在启动时运行python脚本 - How to run python script at startup 为 Windows 编写一个脚本文件(.bat 或 .cmd),这样我就可以在任何 Windows 10 台预装 Python 的 PC 上自动运行现有的 Django 项目 - Write a script file (.bat or .cmd) for Windows, so I can autorun an existing Django Project on any Windows 10 PC with Python preinstalled py安装程序将脚本转换为exe后,如何使python中的脚本在启动时运行 - how to make script in python run at startup after converting it to exe by py installer 如何使异步代码在启动时运行 - Python - How to make async code run on startup - Python 如何从 Python 2.7.3 脚本制作 Windows exe? - How do I make a Windows exe from a Python 2.7.3 script? 如何使python或perl脚本可移植到linux和windows? - how to make a python or perl script portable to both linux and windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM