-
-
Notifications
You must be signed in to change notification settings - Fork 158
[HowTo] Schedule runs on Windows
Vladimir Budylnikov edited this page Jul 15, 2024
·
5 revisions
- Install official git client for Windows and Node.JS any way, you would prefer.
I use Microsoft WinGet:
winget install "git.git" --accept-source-agreements --silent --disable-interactivity
winget install "Node.js" --accept-source-agreements --silent --disable-interactivity
-
Select the path, you want to store repository and browser data. I select
%userprofile%/Documents/Git/
, directoryGit
insideMy Documents
-
Press
🪟Start
button. Search forCMD
there and run this commands:-
Create directories
mkdir %userprofile%\Documents\Git mkdir %userprofile%\Documents\Git\FGC
-
Download repository
cd %userprofile%\Documents\Git\FGC git clone https://github.com/vogler/free-games-claimer.git
-
-
Create script file with name
fgc.bat
in%userprofile%\Documents\Git\FGC
:: Anything after two colons in line in this files is ignored
:: It is used to explain the script
:: This script runs vogler/free-games-claimer to claim free games from different stores
set SHOW=1 :: Change this to 0, if you want to run silently
:: use `set VARIABLE=VALUE` for other environmental variables if you need
cd %userprofile%\Documents\Git\FGC\free-games-claimer :: This it the directory with actual repository
git checkout . :: decline any changes in repository
git pull :: download latest updates
cmd.exe /c npm install package.json :: install needed node.js packages
cmd.exe /c npx playwright install
timeout 360
:: starting the first calim task for user `username1`
echo "username1 epic-games"
set BROWSER_DIR=data/username1 :: select relative directory for user data
cmd.exe /c node epic-games.js :: `cmd.exe /c command` is needed to proceed script in case of errors
:: finishing the first calim task for user `username1`
timeout 360
:: starting the second calim task for user `username2`
echo "username2 epic-games"
set BROWSER_DIR=data/username2
cmd.exe /c node gog.js
timeout 360
Change username1, username2 in echo for better logs You can add as many accounts as you want here, copying last lines in this script
-
Press
🪟Start
button. Search forTask Scheduler
-
Press
Create Basic Task...
on the right panel- Name:
_Free-Games-Claimer
- Trigger:
Daily
- Start:
05:00:00
(or any time you are comfortable to run this script automatically) - Action:
Start program
- Program/Script:
%userprofile%\Documents\Git\FGC\fgc.bat
- Name:
-
Now you can see created task in the scheduler list. Right click on it,
Run
to check.