Hosting using command line client on Windows

I 'm successfully running a host on Windows using Sia-UI. Now I want to make my host run as a background task using command line.
I can see siad.exe and siac.exe files in %LOCALAPPDATA%\Programs\Sia-UI\resources\bin\ folder.
The question is: if all settings have already been set in Sia-UI would it be enough to create an automated task using Task Scheduler and to put just 2 commands in the task:
“siad -M gctwh” and “siac wallet unlock”?
What folder should the commands be started in?
What happens if I log on to Windows and start Sia-UI on the top of running task in the background?
Would it start another copy of siad? take control on the existing daemon? or just crash?

You also need to point siad to your data directory.

The full command on Windows should be: siad -M gctwh -d %APPDATA%\Sia-UI\sia. If you want the wallet to unlock automatically, you should use the environment variable SIA_WALLET_PASSWORD.

If you start Sia-UI it will connect to an existing node if it is already running.

It works! :smiley: Tanks a lot! Although siad.exe appears to be leaking memory, so i have to restart it periodically (( Hope this issue will be fixed in future versions