TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Python Website Blocker | Script Deployment on Windows

Python Website Blocker | Script Deployment on Windows with python tutorial, tkinter, button, overview, entry, checkbutton, canvas, frame, environment set-up, first python program, basics, data types, operators, etc.

<< Back to PYTHON

Script Deployment on Windows

This section of the tutorial illustrates how the python script will be deployed at start-up so that we don't need to open the terminal all the time to run the script.

Lets first change our hosts file path from "/etc/hosts" to "C:\System32\drivers\etc\hosts" as the hosts file is stored at this location on windows.

To schedule the tasks on the windows, we need to open the task scheduler as shown in the below image.

Script Deployment on Windows

Click on Create Task.. given in the right pane of the application.

The following window will open.

Script Deployment on Windows

Configure the properties and give the name and other required properties for your script. Do check the Checkbox as "Run with highest privileges".

Script Deployment on Windows

Go to Triggers and create a new trigger as shown in the below image.

Select the "At startup" option from the drop-down list so that the script can run at start-up.

Script Deployment on Windows

Now, go to Actions and create a new action by clicking on new.

Script Deployment on Windows

The following window will open. Select the "Start a program" action from the drop-down list and browse the path to the script, i.e. blocker.py (in my case it is E:\blocker.py) and click OK.

Script Deployment on Windows

Now, click on Conditions and deselect the 2nd option which says "Start the task only if the computer is on AC power."

Script Deployment on Windows

Now, go to settings and click OK as shown in the following image.

Script Deployment on Windows

Now, we got our task Website-blocker scheduled at system start-up. We can check this in the task list as shown in the following image.

Script Deployment on Windows

Now, we need to restart our system to make the script active on system start-up.

Restart the system now, and try to access the blocked website www.facebook.com as we are in working hours now.

It will show the display which looks like following.

Script Deployment on Windows

Hence, we have got our script working fine on system start-up and block the access to www.facebook.com (or any website you want) automatically.

Next TopicNumPy Tutorial




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf