1

Windows services, by default, run in %WinDir%\System32 (From this answer: What directory does a Windows Service run in? ).

I would like this to be run in C:\Path\To\Django\ instead, and can't change the python code.

I am assuming it will be a regedit key:value, but not sure what it is.

I currently have:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<My Service>\Parameters

the key:value pair

Application: "C:\ProgramData\python.exe" "C:\Path\To\Django\manage.py" runserver

A H
  • 2,164
  • 1
  • 21
  • 36

1 Answers1

1

Add an AppDirectory string value to the Parameters Key and set the value to your desired working directory.

AppDirectory: "C:\Path\To\Django"

Credit to Mark on: https://serverfault.com/questions/114238/windows-service-can-i-configure-the-current-working-directory

A H
  • 2,164
  • 1
  • 21
  • 36