Open manaphychu opened 4 days ago
Is there a way to set the RetroBar Theme from the Command Line? For Example: Luna, is something I want to set it as
not build-in to RetroBar, but here is a bat file that does exactly that.
save as ChangeRetroBarTheme.bat and run as administrator (check that the retrobar path is correct on the end of the file)
Example of theme name to type if you want to change to win xp blue:
Windows XP Blue
dont include " " in the theme name or .xaml, just the name of the theme.
@echo off
setlocal enabledelayedexpansion
:: Define the path to the settings.json file
set "file_path=%LocalAppData%\RetroBar\settings.json"
:: Check if the file exists
if not exist "%file_path%" (
echo File not found: %file_path%
pause
exit /b
)
:: Prompt the user for the new theme value
set /p new_theme=Enter the new theme:
:: Create a temporary file
set "temp_file=%file_path%.new"
:: Process the file line by line
(
for /f "usebackq delims=" %%i in ("%file_path%") do (
set "line=%%i"
echo !line! | findstr /c:"\"Theme\"" >nul
if not errorlevel 1 (
echo "Theme": "!new_theme!",
) else (
echo !line!
)
)
) > "%temp_file%"
:: Replace the original file with the updated one
move /y "%temp_file%" "%file_path%" >nul
echo Theme updated successfully to "%new_theme%".
:: Kill the RetroBar process
taskkill /f /im RetroBar.exe >nul 2>&1
:: Start RetroBar again
start "" "C:\Program Files\RetroBar\RetroBar.exe"
echo RetroBar has been restarted.
pause
and if you want the bat to not ask user for theme name, do this:
change
set /p new_theme=Enter the new theme:
to
set "new_theme=Windows XP Blue"
and remove the "pause" from the end of the bat
trying to get this to work but won't
trying to get this to work but won't
what is the theme file name?
Luna.xaml or what?
I am trying to change this to XP Blue but won't change theme, any other way to make it work with the BAT File for changing the entire theme of Windows?
trying to get this to work but won't
what is the theme file name?
Luna.xaml or what?
@echo off setlocal enabledelayedexpansion
:: Define the path to the settings.json file set "file_path=%LocalAppData%\RetroBar\settings.json"
:: Check if the file exists if not exist "%file_path%" ( echo File not found: %file_path% pause exit /b )
:: Prompt the user for the new theme value set new_theme=Windows XP Blue
:: Create a temporary file set "temp_file=%file_path%.new"
:: Process the file line by line ( for /f "usebackq delims=" %%i in ("%file_path%") do ( set "line=%%i" echo !line! | findstr /c:"\"Theme\"" >nul if not errorlevel 1 ( echo "Theme": "!new_theme!", ) else ( echo !line! ) ) ) > "%temp_file%"
:: Replace the original file with the updated one move /y "%temp_file%" "%file_path%" >nul
echo Theme updated successfully to "%new_theme%".
:: Kill the RetroBar process taskkill /f /im RetroBar.exe >nul 2>&1
:: Start RetroBar again start C:\Classic\RetroBar\RetroBar.exe
echo RetroBar has been restarted.
here's the command
the command you used for set windows xp blue is wrong,
try this one: (see the difference?)
@echo off
setlocal enabledelayedexpansion
set "new_theme=Windows XP Blue"
set "file_path=%LocalAppData%\RetroBar\settings.json"
if not exist "%file_path%" (
echo File not found: %file_path%
pause
exit /b
)
set "temp_file=%file_path%.new"
(
for /f "usebackq delims=" %%i in ("%file_path%") do (
set "line=%%i"
echo !line! | findstr /c:"\"Theme\"" >nul
if not errorlevel 1 (
echo "Theme": "!new_theme!",
) else (
echo !line!
)
)
) > "%temp_file%"
move /y "%temp_file%" "%file_path%" >nul
taskkill /f /im RetroBar.exe
start "" "C:\Program Files\RetroBar\RetroBar.exe"
still nope...
the command you used for set windows xp blue is wrong,
try this one: (see the difference?)
@echo off setlocal enabledelayedexpansion set "new_theme=Windows XP Blue" set "file_path=%LocalAppData%\RetroBar\settings.json" if not exist "%file_path%" ( echo File not found: %file_path% pause exit /b ) set "temp_file=%file_path%.new" ( for /f "usebackq delims=" %%i in ("%file_path%") do ( set "line=%%i" echo !line! | findstr /c:"\"Theme\"" >nul if not errorlevel 1 ( echo "Theme": "!new_theme!", ) else ( echo !line! ) ) ) > "%temp_file%" move /y "%temp_file%" "%file_path%" >nul taskkill /f /im RetroBar.exe start "" "C:\Program Files\RetroBar\RetroBar.exe"
still nope
what is the path to retrobar.exe?
this bat works fine on my end
what is the path to retrobar.exe?
this bat works fine on my end
for me: C:\Classic\RetroBar
C:\Classic\RetroBar
@echo off
setlocal enabledelayedexpansion
set "new_theme=Windows XP Blue"
set "file_path=%LocalAppData%\RetroBar\settings.json"
if not exist "%file_path%" (
echo File not found: %file_path%
pause
exit /b
)
set "temp_file=%file_path%.new"
(
for /f "usebackq delims=" %%i in ("%file_path%") do (
set "line=%%i"
echo !line! | findstr /c:"\"Theme\"" >nul
if not errorlevel 1 (
echo "Theme": "!new_theme!",
) else (
echo !line!
)
)
) > "%temp_file%"
move /y "%temp_file%" "%file_path%" >nul
taskkill /f /im RetroBar.exe
start "" "C:\Classic\RetroBar\RetroBar.exe"
test:
C:\Classic\RetroBar
@echo off setlocal enabledelayedexpansion set "new_theme=Windows XP Blue" set "file_path=%LocalAppData%\RetroBar\settings.json" if not exist "%file_path%" ( echo File not found: %file_path% pause exit /b ) set "temp_file=%file_path%.new" ( for /f "usebackq delims=" %%i in ("%file_path%") do ( set "line=%%i" echo !line! | findstr /c:"\"Theme\"" >nul if not errorlevel 1 ( echo "Theme": "!new_theme!", ) else ( echo !line! ) ) ) > "%temp_file%" move /y "%temp_file%" "%file_path%" >nul taskkill /f /im RetroBar.exe start "" "C:\Classic\RetroBar\RetroBar.exe"
test:
not working for me?!
you need to run it as administrator:
shift+rightclick the bat file and select "run as administrator"
still no sign of theme changing
still no sign of theme changing
can you save it to c:\classic\changetheme.bat
then hit windowsbutton+r and type "cmd"
now type "c:\classic\changetheme.bat" take a screenshot and send here so we can see if it gives some kind of error.
ughhh... it won't, god dammit windows
ok so there is a permission error, you dont have admin rights apparently
ok so there is a permission error, you dont have admin rights apparently
how do I make it not reject the change? without admin permissions?
type this to cmd
net user %username%
does it say "administrators" at the bottom?
yeah
well try closing retrobar manually and then run the bat when retrobar is not running
if this works, then something is blocking the taskkill command, might be antivirus protecting you?
idk?
test running the bat when retrobar is closed and i might have a possible fix for you, first we need to find the problem
because it won't change theme when open
because it won't change theme when open
it will change, but on your case it does not. so try this then, it closes retrobar first:
@echo off
setlocal enabledelayedexpansion
set "new_theme=Windows XP Blue"
set "file_path=%LocalAppData%\RetroBar\settings.json"
taskkill /f /im RetroBar.exe
if not exist "%file_path%" (
exit /b
)
set "temp_file=%file_path%.new"
(
for /f "usebackq delims=" %%i in ("%file_path%") do (
set "line=%%i"
echo !line! | findstr /c:"\"Theme\"" >nul
if not errorlevel 1 (
echo "Theme": "!new_theme!",
) else (
echo !line!
)
)
) > "%temp_file%"
move /y "%temp_file%" "%file_path%" >nul
start "" "C:\Classic\RetroBar\RetroBar.exe"
uuuughhh! nope.... it doesn't...
type this to cmd and take a screenshot:
tasklist /fi "imagename eq RetroBar.exe"
where do I put it in?
my PID for RetroBar is 3696
my PID for RetroBar is 3696
take screenshot so i can see if these give error, type exactly what i typed:
The process cannot access the file because it is being used by another process.... :( TWO TIMES!
The process cannot access the file because it is being used by another process.... :(
do you have something else also running? like OpenShell or similar? that might be the reason this is failing
another possibilities: no administrator access antivirus is blocking taskkill command
no admin access... :(
Dremin needs to make a new feature where you can set the theme from one single command line without restart
because I was working on a modification of the Windows eXPerience Extras Pack Theme Changer for my Windows 11 Customization Pack
well i will make it for you, maybe an hour and it is done? probably, lets see (no promises)
give me some details what you want from the cmd command?
RetroBar.exe -ChangeTheme "Windows Xp Blue"
is this good?
lemme try
I mean i can make a feature for it and the make a pull request so you can download a retrobar with cmd functionality, that is not a problem, i can do it if you want something like that.
sure
ok, i will post it here when it is done.
thx
yeah i have it working now, i am just cleaning code, mayb 10 minutes and you can test
here you go:
i tested and it works fine on my system. details on the pull request.
nope, download failed, something went wrong.
it detected a threat... what a pain in the ass for me..
you can compile it yourself too if you have visual studio
it is no trojan for sure, i just compiled it myself https://www.mediafire.com/file/bvmkene8a8kut56/RetroBar-cmd-net6.0-windows.rar
download failed again... ðŸ˜
WHY WINDOWS DEFENDER?!!?
Is there a way to set the RetroBar Theme from the Command Line? For Example: Luna, is something I want to set it as