Python Forum
run python file on background and start on windows boot
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
run python file on background and start on windows boot
#7
A batch file is just a series of commands to be executed in the command line. If you have ever executed your script from the command prompt you already know all you need.
Create a text file and write down the steps you would follow to execute your python script:
1. You change the directory to where the script is located.
2. run the script
So your text file would look something like this:
Quote:cd C:\\Users\\Location_of_script
python script.py
Then rename the text file with a '.bat' extension. Now put this file in the startup folder.

Points to note:
1. Ensure that Python is added as an environment variable
2. Batch files are wonderful for a multitude of other things. Check it out!
Reply


Messages In This Thread
RE: run python file on background and start on windows boot - by cryomick - Jan-02-2018, 11:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ## Its part of my boot camp Task Raselrameda 7 2,989 Feb-14-2022, 05:20 PM
Last Post: Raselrameda
  As a new to Python & Hadoop I don't know where to start, I need your suggestion chanduporeddy 1 1,625 Oct-04-2019, 06:52 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020