Procswap is a simple application that allows you to prioritize processes on a Windows machine.

procswap

Procswap is a simple application that allows you to prioritize processes on a Windows machine. This is great for mining when you want to mine all the time unless certain processes (looking at you Cyberpunk) are running.

It works by allowing the user to pass in their mining scripts and scanning a given directory for all .exe files and marking these as priorities. It polls the processes running in Windows to check if one of these .exe priorities has started (e.g. Hades.exe has launched), and then stops all passed in scripts. Whenever there are no priority processes running, like when you get tired of playing Cyberpunk and close it, it launches all passed in scripts - these scripts are paths to your .bat files that start your miners.

Getting Started

  • Download the latest version from the releases page or build it from source if you don't like running random executables found on the internet.
  • You'll have to open a command prompt and you might want to run it as Administrator.
  • Change directory to where you downloaded the procswap.exe (probably your Downloads folder).

Examples

I like to have procswap scan my Steam games directory for .exe files and run two .bat files, one for PheonixMiner and another for XMRig.

My command looks something like this:

procswap.exe --priority D:\Steam\steamapps\common --swap C:\Mining\PhoenixMiner\start_miner.bat --swap c:\Mining\xmrig\start.cmd

I store my steam games on drive D:\ so I passed in the link to the common directory where all the games are held. I passed in two "swap" processes that will run whenever there's no games running. The two .bat scripts I passed in are for my PheonixMiner script and one for XMRig. You can pass in as many priority directories or swap processes that you want. Just keep in mind that if any priority process starts, all swap processes are stopped.

The output looks something like this:

As you can see, the first thing that happened is it scanned my games folder, found all the executables and since none were running started up my .bat files to start mining! When I opened Hades, it logged that this priority process started and stopped all my scripts. When I quit playing Hades it started them up again. Efficient mining!

Switching Afterburner profiles automatically

You probably have different Afterburner profiles for mining/gaming. Procswap allows you to run a script whenever a game starts so you can set your Afterburner profile to your gaming profile.

For this example, Profile1 is my mining profile and Profile2 is my gaming profile.

Here's my command (make sure to run as Administrator):

procswap.exe --priority D:\Steam\steamapps\common --swap C:\Mining\PhoenixMiner\start_miner.bat --priority-script C:\Mining\procswap\priority_script.bat

In the above command I set my priorities to be my Steam games directory D:\Steam\steamapps\common and my swap process (mining batch file) to C:\Mining\PhoenixMiner\start_miner.bat. I've now added a flag --priority-script which will run C:\Mining\procswap\priority_script.bat whenever a priority .exe under the Steam games directory starts.

You will need to set your profile to mining mode in your miner .bat file.

Here's the contents of C:\Mining\PhoenixMiner\start_miner.bat, note that I am setting my Afterburner profile to Profile1.

REM
REM Example bat file for starting PhoenixMiner.exe to mine ETH
REM

setx GPU_FORCE_64BIT_PTR 0
setx GPU_MAX_HEAP_SIZE 100
setx GPU_USE_SYNC_OBJECTS 1
setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_SINGLE_ALLOC_PERCENT 100

REM Set the profile to be the mining profile.
"C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe" -Profile1

REM IMPORTANT: Replace the ETH address with your own ETH wallet address in the -wal option (Rig001 is the name of the rig)
C:\Mining\PhoenixMiner\PhoenixMiner.exe -pool us1.ethermine.org:4444 -pool2 us2.ethermine.org:4444 -wal 8BAFF6bE0ecb72A55eB442ccae5A2f5B96AfFB3e -worker rig01
pause

Here's the contents of C:\Mining\procswap\priority_script.bat, the script that runs whenever a game starts up. I set my Afterburner profile to my gaming profile here.

@echo off
"C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe" -Profile2

Your Afterburner profiles should now automatically switch between mining and gaming mode appropriately.

Notes

This project was created casually over the course of a couple days. Any feedback or suggestions are welcome.

Comments
  • feature: give ability to easily see output from swap scripts

    feature: give ability to easily see output from swap scripts

    It would be nice to see the output or failure from swap scripts passed in.

    This could be either done by pressing s to switch between output in the same command prompt or by having procswap open the output of these swaps in new terminals (probably more difficult).

  • Procswap Not Opening Miner.

    Procswap Not Opening Miner.

    Describe the bug Procswap is not opening the Phoenixminer bat file. It says start ok but doesn't actually open it. My command looks like this: procswap.exe --priority E:\Steam\steamapps\common --swap C:\Users\Peeps\Downloads\Tools\PhoenixMiner\start_miner.bat

    Screenshots delete

  • add actions

    add actions

    • adds the action to switch console output to that of a running swap file when the s key is pressed
    • adds logs to inform the user which output is being shown
    • adds the --disable-actions flag in case users experience bad behavior because of key input
    • removes redundant input of [PROCSWAP] at the beginning of each log
  • feature: swap msi afterburner oc profiles

    feature: swap msi afterburner oc profiles

    When gaming you'd want to use your own profile or stock settings since the high memory oc can result in instabilities.

    We can already activate an oc profile by adding "C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe" -Profile1 to the miner .bat file, however, I don't think we can apply a gaming profile once mining stops.

  • Doesn't directly work with Windows Store games

    Doesn't directly work with Windows Store games

    Truly an amazing program, thank you. There may not be anything that can be done about this. Windows Store game exes are stored in the C:\Program Files\WindowsApps folder which even the administrator can't look at the files. Procswap says it can't "walk" the directory, even when run as administrator. The workaround is I made a folder to scan which has zero-byte files with game exe names in them that I created. At the very least I'm curious if there's better way of doing it.

  • feature: choose which GPUs should swap

    feature: choose which GPUs should swap

    When using PC on a daily basis I want to have my GPU for games when I run them. This works fine, but what if I have 3 GPUs from which only one can be used for gaming (well maybe two if some kind of SLI).

    Would be really awesome if I can stop miner on given GPUs rather then stopping it totally. Other cards can continue mining while I play on one of the 'main" cards.

  • Duplicate process names causing unwanted swaps

    Duplicate process names causing unwanted swaps

    If a .exe in a priority folder shares a name with an .exe in a non-priority folder, an unwanted swap will trigger when the non-prioritized .exe is running

  • Procswap only killing one instance of miner.exe

    Procswap only killing one instance of miner.exe

    Hi,

    I was able to setup the app just fine and it seems to be working however,

    My bat file seems to launch 2 instances of miner.exe one 57mb another 275mb

    when procswap stops my bat file it seems it leaves the 275mb instance of the miner.exe running .... which means the GPU tries to balance the load over both the remaning miner.exe instance and another app or game from my priorities...

    when closing the game it launches 2 new instances of miner.exe another 57mb and 275mb + still leaving the 1st 275mb one alive, balancing the load over now 3 miner.exe's

    I dont seem to have this issue when just running the bat file by itself and closing it just closes both instances of miner.exe However doing the same through your app sort of spawns more 275mb instances asking for GPU load as the app continues to start and stop my miner bat file.

    The miner bat file does not contain anything other than the standard gminer config.

    Any ideas how to fix this ?

  • add implementation for ignore flag

    add implementation for ignore flag

    • adds --ignore flag to ignore a given executable (case insensitive)
    • --ignore flag is a StringSlice so that users can pass in as many .exe files that they want to ignore
  • make initial directory scan much faster

    make initial directory scan much faster

    Using godirwalk.Walk instead of filepath.Wallk I was able to get the initial directory scan down from ~4 minutes to ~15 seconds for a directory with 300,000+ files.

    Read more about godirwalk here.

  • Resolve #8

    Resolve #8

    This PR allows the user to set a script that will run whenever a priority starts. This is useful for automating switching your MSI Afterburner profile from mining mode to gaming mode.

    • add flag --priority-script
    • add logs for when this script is registered and when it starts
  • Feature request: Gracefully close miner

    Feature request: Gracefully close miner

    I am using NiceHash QuickMiner, which applies overclocking settings when I run, and resets them when I close it. But when I use procswap, it doesn't reset my card settings for gaming. So, I guess procswap just kills the process right?

    Can we have an option for gracefully close miner? It would be useful for users like me.

    Thanks!

Related tags
this allows you to get the real link of bit.ly
this allows you to get the real link of bit.ly

check the real url from a url shortener (bit.ly) Also you can use it as an API example with deno const rawResponse = await fetch("https://anti-url-s

Feb 19, 2022
This Go package allows you to set handler functions that run when named events occur

This Go package allows you to set handler functions that run when named events occur

Feb 10, 2022
sigurls is a reconnaissance tool, it fetches URLs from AlienVault's OTX, Common Crawl, URLScan, Github and the Wayback Machine.

sigurls is a reconnaissance tool, it fetches URLs from AlienVault's OTX, Common Crawl, URLScan, Github and the Wayback Machine. DiSCLAIMER: fe

May 22, 2021
📋 cross-platform clipboard package that supports accessing text and image in Go (macOS/Linux/Windows/Android/iOS)

clipboard Cross platform (macOS/Linux/Windows/Android/iOS) clipboard package in Go import "golang.design/x/clipboard" Features Cross platform supports

Dec 24, 2022
get windows system call number dynamically, it doesn't need the system call table.

GetSyscallID get windows system call number dynamically, it doesn't need the system call table. Try download go get github.com/akkuman/getsyscallid/cm

Jun 1, 2022
Package ethtool allows control of the Linux ethtool generic netlink interface.

ethtool Package ethtool allows control of the Linux ethtool generic netlink interface.

Dec 14, 2022
memresolver is an in-memory golang resolver that allows to override current golang Lookup func literals

mem-resolver memresolver is an in-memory golang resolver that allows to override current golang Lookup func literals How to use it Create your custom

Jun 23, 2022
EGo lets you build, debug und run Go apps on Intel SGX - as simple as conventional Go programming!

EGo lets you build, debug und run Go apps on Intel SGX - as simple as conventional Go programming!

Dec 28, 2022
This is a simple HTTP application that returns system info

sysinfo This is a simple HTTP application that returns system info. Trace Support There is also simple OpenTelemetry tracing support via the -t flag.

Dec 25, 2022
cuckoo-filter go implement. config by you 布谷鸟过滤器的Go实现,可以定制化过滤器参数

Cuckoo filter is a Bloom filter replacement for approximated set-membership queries. While Bloom filters are well-known space-efficient data structures to serve queries like "if item x is in a set?", they do not support deletion. Their variances to enable deletion (like counting Bloom filters) usually require much more space.

Jan 1, 2023
go-i18n is a Go package and a command that helps you translate Go programs into multiple languages.

go-i18n is a Go package and a command that helps you translate Go programs into multiple languages.

Jan 2, 2023
this is an api that execute your deno code and send you the output

this a simple api that execute your deno code and send you the output, has not limit per request example request: in deno: const rawResponse = await f

Dec 23, 2022
Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.
Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.

Clean-Swift source & test code auto generator Overview Run Output Basic Usage make config.yaml target_project_name: Miro // target project name copyri

Apr 13, 2022
How much you spend for glovo. Make config file and launch yourself

how_much_you_spend How much you spend for glovo. Make config file and launch yourself, you are welcome! Put config file in the same folder as executab

Nov 9, 2021
With Pasteback you can store common terms and paste them back to clipboard

Pasteback With Pasteback you can store common terms and paste them back to clipboard when needed. There is one central spot to put every string into y

Nov 22, 2021
JIN the coolest fighting game ever made that uses the M.U.G.E.N engine so heres how you can build it

JIN the coolest fighting game ever made that uses the M.U.G.E.N engine so heres how you can build it

Jan 24, 2022
Color lets you use colorized outputs in terms of ANSI Escape Codes in Go (Golang)
Color lets you use colorized outputs in terms of ANSI Escape Codes in Go (Golang)

Color lets you use colorized outputs in terms of ANSI Escape Codes in Go (Golang). It has support for Windows too! The API can be used in several ways, pick one that suits you.

Feb 5, 2022
A pluggable backend API that enforces the Event Sourcing Pattern for persisting & broadcasting application state changes
A pluggable backend API that enforces the Event Sourcing Pattern for persisting & broadcasting application state changes

A pluggable "Application State Gateway" that enforces the Event Sourcing Pattern for securely persisting & broadcasting application state ch

Nov 1, 2022
A set of instrumentation features for collecting relevant tracing data as well as secure an application

Go Agent goagent provides a set of instrumentation features for collecting relevant tracing data as well as secure an application by blocking requests

Dec 21, 2021