Run command / script when program starts in Windows

Solution 1:

You can achieve this with Bill2's Process Manager.
It gives you the ability to create a rule when a process starts.
The process manager is already configured to start with windows.
You will want to go into options and change the software to English, then check
Checkbox Minimize to system tray instead of exiting when close button is clicked
to keep the it running in the background.
You can also set a username and password for the interface under the Security menu in options.

Create a rule to lock windows when uTorrent starts

  1. Open uTorrent
  2. Open Bill2's Process Manager
  3. Find the uTorrent process and right click on it, select Create a rule for this process
  4. Click on the Special Actions tab
  5. CheckboxLaunch one or many programs
  6. Fire in your lock command rundll32.exe user32.dll, LockWorkStation
  7. Hit Ok and test your work

Solution 2:

Though not specifically for Windows 10, this answer should work: How to start a program when another one is started. The only difference is that you will have to specify a script, not a program.

My intention was to comment this instead of answering but I lack reputation score.