Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Restart Local Folding@Home Client
Name: Restart Folding@Home
Author: Bryan Vine
Date: 3/25/2020
Description: Restarts the local Folding @ Home client while cleaning out existing work to reset the connection countdown timer.
Notes: It will remove all existing work, so make sure you only run this if it's stuck in waiting for download.
#Requires -Version 3.0
if(Get-Service -name "*Folding@Home*"){
Get-Service -name "*Folding@Home*" | Stop-Service -Verbose
Get-Process -Name FAHClient -ErrorAction SilentlyContinue| Stop-Process -Verbose
Start-Sleep -Seconds 3
if(!(dir "C:\Users\$($env:USERNAME)\AppData\Roaming\FAHClient\work\" -directory)){
Remove-Item "C:\Users\$($env:USERNAME)\AppData\Roaming\FAHClient\work\client.db*" -Force -Verbose
if(Get-Service -name "*Folding@Home*"){
Get-Service -name "*Folding@Home*" | Start-Service -Verbose
Write-Verbose "Started FAHClient Service" -Verbose
cd "C:\Users\$($env:USERNAME)\AppData\Roaming\FAHClient"
. "C:\Program Files (x86)\FAHClient\HideConsole.exe" "C:\Program Files (x86)\FAHClient\FAHClient.exe"
Write-Verbose "Started FAHClient" -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment