Page 1 of 1

Win - send FINISH command at certain time

Posted: Fri Sep 19, 2025 6:25 am
by foldinghomealone
Hi there,

I'm back, at least I will be trying to fold in the cold months.
However, due to my current electricity price, I can afford folding only in the night (because it is way cheaper in the night).
Is there an option to somehow send the FINISH command to the new client?

Ideally, it would be possible per resource group. (as different HW needs different finishing times)

Is there a way to do so?
I hope so, otherwise I won't be able to fold. I can't afford to get up at 3am just to press the finish button.

Thanks in advance

Re: Win - send FINISH command at certain time

Posted: Fri Sep 19, 2025 8:47 am
by calxalot

Re: Win - send FINISH command at certain time

Posted: Fri Sep 19, 2025 8:52 am
by calxalot
If python is not installed, you can get prompted to install it from the Microsoft store.
Open powershell and use command

Code: Select all

python --version

Re: Win - send FINISH command at certain time

Posted: Fri Sep 19, 2025 10:52 am
by foldinghomealone
I will try today evening. Thanks.
Hope I can deal with it. Never used Python or Powershell etc...

Re: Win - send FINISH command at certain time

Posted: Fri Sep 19, 2025 8:31 pm
by calxalot
You will also need to use task scheduler.

https://www.bing.com/search?q=schedule% ... E3ED16BCAA

Re: Win - send FINISH command at certain time

Posted: Fri Sep 19, 2025 9:54 pm
by foldinghomealone
yeah thank. Your lufah tool works great

Re: Win - send FINISH command at certain time

Posted: Wed Sep 24, 2025 8:56 pm
by foldinghomealone
I wanted to share the scripts I'm using to send a finish command at a certain time:

I have one Resource Group for my GPU ("gpu") and one Resource Group for my CPU ("cpu").
I am using two scripts for each Resource Group.

The first scripts schedules a task to start the second script at a certain time.
The second script will then send the FINISH command to the FAH client.

First script --> schedules task to start second script at certain time

Code: Select all

@echo off
:: ======================================
:: foldinghomaleone
:: CONFIGURATION – ADJUST ONLY HERE
:: ======================================
set STARTTIME=04:45
set TASKNAME=MyScheduledGPUTask
set TASKFILE="C:\Users\me\Desktop\gpufinish.bat"

:: ======================================
:: Convert STARTTIME to HHmm format for comparison (e.g. 04:00 -> 0400)
set TIMECOMPARE=%STARTTIME::=%

:: Get current time in HHmm format
for /f %%i in ('powershell -command "Get-Date -Format HHmm"') do set CURRENTTIME=%%i

:: ======================================
:: Determine start date: today or tomorrow?
if %CURRENTTIME% GEQ %TIMECOMPARE% (
    :: After the scheduled time – schedule task for tomorrow
    for /f %%i in ('powershell -command "(Get-Date).AddDays(1).ToString('MM/dd/yyyy')"') do set STARTDATE=%%i
) else (
    :: Before the scheduled time – schedule task for today
    for /f %%i in ('powershell -command "(Get-Date).ToString('MM/dd/yyyy')"') do set STARTDATE=%%i
)

:: ======================================
:: Create or replace the scheduled task
SCHTASKS /Create /SC ONCE /TN "%TASKNAME%" /TR %TASKFILE% /ST %STARTTIME% /SD %STARTDATE% /F

:: ======================================
:: Show scheduled task info (directly from Task Scheduler)
echo.
echo === Scheduled Task Information ===
SCHTASKS /Query /TN "%TASKNAME%" /V /FO LIST

pause
Second script --> finish command

Code: Select all

@echo off
cd c:\Users\me

:: systax: lufah -a /RescourceGroup finish
lufah -a /gpu finish

echo GPU set to finish at %TIME%
pause
Feel free to share and adjust to your liking

Re: Win - send FINISH command at certain time

Posted: Mon Sep 29, 2025 2:05 pm
by appepi
Thanks. I have the same need to control folding time (off peak electricity 10pm-7am) and currently use 7.6.21 and Lar Systems timer, but will presumably try this when/if they stop working.