2014-10-16, 21:06
(2014-10-16, 21:00)peglegtv Wrote:(2014-10-16, 20:49)peppy6582 Wrote:(2014-10-16, 19:34)peglegtv Wrote: ya, last night I tested swapping out the playlist and it only works if i do a "force channel reset" which is closer but I know I can get it fully automated, so now I'm trying to figure out how to use a batch file to edit the settings.xml line
Code:<setting id="ForceChannelReset" value="false" />
to
Code:<setting id="ForceChannelReset" value="true" />
so that i don't have to remember to do the reset each time
thanks for all the help
Try this:
Code:@echo OFF
@setlocal ENABLEDELAYEDEXPANSION
set fileName=settings2.xml
if exist %fileName%.tmp del /F /Q %fileName%.tmp
for /F "delims=" %%G in (%fileName%) do (
set LINE=%%G
if not "!LINE!" == "!LINE:ForceChannelReset=!" (
set LINE=!LINE:False=True!
)
>> "%fileName%.tmp" echo !LINE!
)
del /F /Q %fileName%
ren %fileName%.tmp %fileName%
@endlocal
worked great, noticed it was set to settings2.xml had to change that to settings.xml (I just figured it out with autohotkey as well but i'll stick with batch file) heres the fixed version in case someone else wants to use it
Code:@echo OFF
@setlocal ENABLEDELAYEDEXPANSION
set fileName=settings.xml
if exist %fileName%.tmp del /F /Q %fileName%.tmp
for /F "delims=" %%G in (%fileName%) do (
set LINE=%%G
if not "!LINE!" == "!LINE:ForceChannelReset=!" (
set LINE=!LINE:False=True!
)
>> "%fileName%.tmp" echo !LINE!
)
del /F /Q %fileName%
ren %fileName%.tmp %fileName%
@endlocal
Thanks for the help
Yeah, I am a goober, and didn't realize that is in settings.xml so I just added it to settings2.xml and played until I got it right. My bad!