View Single Post
Old 08-09-2020, 11:42 PM   #966
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,978
Karma: 169810634
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by jhowell View Post
I modified your .cmd file to not require a separate .reg file and to poll the registry and patch the value once Kindle for PC has set it. That should make it work more quickly on fast systems and prevent it from failing on slow systems.

The file is attached for testing. Unzip and run. (On some systems you may need to unblock it by right clicking, selecting Properties and then in the dialog checking Unblock then OK.)

Spoiler:
Code:
reg delete "HKEY_CURRENT_USER\SOFTWARE\Amazon\Kindle\User Settings" /v "isKRFDRendererSupported" /f
start %LOCALAPPDATA%\Amazon\Kindle\application\kindle.exe
:repeat
timeout 1
reg query "HKEY_CURRENT_USER\SOFTWARE\Amazon\Kindle\User Settings" /v "isKRFDRendererSupported"
if ERRORLEVEL 1 goto :repeat
reg add "HKEY_CURRENT_USER\SOFTWARE\Amazon\Kindle\User Settings" /v "isKRFDRendererSupported" /t REG_SZ /d "false" /f
In response to a PM from a user who has a space in her user name, I modified the cmd file to add a "" and "s around the command line that runs kindle.exe. Without the blank "", Windows treated the command line as the title.

Spoiler:
Code:
@echo off
rem delete the registy key controlling KFX downloads

reg delete "HKEY_CURRENT_USER\SOFTWARE\Amazon\Kindle\User Settings" /v "isKRFDRendererSupported" /f

rem start K4PC from the default location or admin install location.  This can be modified for non-standard installs
rem the "" sets the title for the DOS box.  This was needed when the location for the segment
rem that starts K4PC had a user name with an embedded space requiring the "...." wrapper

set KINDLE=%LocalAppData%\Amazon\Kindle
set KINDLE_EXE=%PROGRAMFILES(X86)%\Amazon\Kindle

cd "%KINDLE%"

if not exist "%KINDLE_EXE%\Kindle.exe" goto :next
start "" "%KINDLE_EXE%\kindle.exe"
goto :repeat

:next
if not exist "%KINDLE%\application\Kindle.exe" goto :error
start "" "%KINDLE%\application\kindle.exe"

rem this loop waits for the isKRFDRendererSupported key to be created
:repeat
timeout 1
reg query "HKEY_CURRENT_USER\SOFTWARE\Amazon\Kindle\User Settings" /v "isKRFDRendererSupported"
if ERRORLEVEL 1 goto :repeat

rem when we arrive here, the key has been created, replace it with a version that does not allow KFX downloads
reg add "HKEY_CURRENT_USER\SOFTWARE\Amazon\Kindle\User Settings" /v "isKRFDRendererSupported" /t REG_SZ /d "false" /f
goto :ender

:error
echo Could not start Kindle4PC from either location tried.

:ender
rem  wait for any key to be hit to close the command windows.  remove the pause statement to auto-close
pause


Edit: the batch file has been updated to start Kindle4PC from either the normal user install location or the admin user install location without needing to be edited.
Attached Files
File Type: bat KFX_begone4.bat (1.4 KB, 11094 views)

Last edited by DNSB; 06-10-2021 at 03:06 PM.
DNSB is offline