Copied from superuser.com:
You can use the sc config command to change the path a service points to.
C:\>sc config YourServiceName binPath= "C:\SomeDirectory\YourFile.EXE"
This will update the service called YourServiceName and change the "Path to Executable" entry to C:\SomeDirectory\YourFile.EXE. You will want to restart your service afterwards, which you can do with:
C:\>net stop YourServiceName
C:\>net start YourServiceName
Note there is a required space between binpath= and the command