Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-08-2021, 04:03 PM   #1261
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: 13,442
Karma: 65505905
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by dieselnutjob View Post
The second line of the .bat script says
set KINDLE=%LocalAppData%\Amazon\Kindle

what I actually have is c:\Users\myname\AppData\Local\Amazon\Kindle

if I go to a command prompt and type
C:\>cd %LocalAppData%

I go to

C:\Users\myname\AppData\Local>

the third line of the script is
if not exist "%KINDLE%\application\Kindle.exe" goto :nokindle

so that means %LocalAppData%\Amazon\Kindle\applications\Kindle.e xe

which on my system is C:\Users\myname\AppData\Local\Amazon\Kindle\applic ations\Kindle.exe

I don't have an applications folder in there.

My Kindle.exe is at
C:\Program Files (x86)\Amazon\Kindle\Kindle.exe
That script assumes that you have installed Kindle4PC in it's default location. The %LocalAppData% variable is a Windows environment variable pointing to X:\Users\username\AppData\Local where X is the drive letter and username is the local user name. See the Complete list of environment variables on Windows 10 for a list of these variables.

Since you did not install Kindle4PC in it's default location, the script is unable to find it. You could try defining the Kindle variable as C:\Program Files (x86)\Amazon\Kindle and changing any references to remove the \application from the string. I don't have a Kindle4PC install in a non-standard directory so the storage and updates directories may be in different locations for you. If so, change the locations to match in the batch file. I went on the assumption that the data storage would be in the same location. Sample below for your kindle.exe install location.

Edit: the line reading "if exist "%KINDLE%\storage" if not exist "%KINDLE%\storage\" del /Q "%KINDLE%\storage" " doesn't really make sense but I didn't bother changing it.

Code:
@echo off
set KINDLE=%LocalAppData%\Amazon\Kindle
set KINDLE_EXE=%PROGRAMFILES(X86)%\Amazon\Kindle
if exist "%KINDLE_EXE%\Kindle.exe" goto :found
if not exist "%KINDLE%\application\Kindle.exe" goto :nokindle
:found
rem still not sure what the following line is for
if exist "%KINDLE%\storage" if not exist "%KINDLE%\storage\" del /Q "%KINDLE%\storage"
if exist "%KINDLE%\updates" rmdir /S /Q "%KINDLE%\updates"
echo This file disables Kindle for PC downloads. > "%KINDLE%\updates"
echo Kindle for PC downloads are now disabled
goto :exit
:nokindle
echo Cannot disable downloads - Kindle for PC is not installed at expected location
:exit
pause

Last edited by DNSB; 06-09-2021 at 01:26 AM. Reason: Added comment on if exist/if not exist line. Modified batch file tol work with default and program files install locations.
DNSB is offline   Reply With Quote
Old 06-09-2021, 06:33 AM   #1262
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 26,317
Karma: 41365351
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
%appdata% resolves as the current user so your system is taking you to the correct place.

%appdata% is where CONFIGURATIONS are stored. The 3 sections are how far they extend out in enterprises. eg Local depends on specific resources for a particular machine.

settings done in program files was a security hole that got patched up a long time ago. Now you need to have special permissions (UAC) to make changes.
theducks is online now   Reply With Quote
Old 06-09-2021, 09:46 AM   #1263
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 4,478
Karma: 44061161
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by DNSB View Post
Since you did not install Kindle4PC in it's default location, the script is unable to find it. You could try defining the Kindle variable as C:\Program Files (x86)\Amazon\Kindle and changing any references to remove the \application from the string. I don't have a Kindle4PC install in a non-standard directory so the storage and updates directories may be in different locations for you. If so, change the locations to match in the batch file. I went on the assumption that the data storage would be in the same location. Sample below for your kindle.exe install location.
I have updated "disable k4pc download.bat" in the first post of this thread with your changes.

Hopefully someone will try it and report back on whether or not it is effective at blocking updates when Kindle for PC is installed in the alternate location.

Quote:
Originally Posted by DNSB View Post
Edit: the line reading "if exist "%KINDLE%\storage" if not exist "%KINDLE%\storage\" del /Q "%KINDLE%\storage" " doesn't really make sense but I didn't bother changing it.
That line exists to fix the damage done by a bug in the original version of the script which was available for a short time. That bad version replaced the wrong folder, leaving Kindle for PC non-functional. Anyone who ran that bad script can run a newer version to correct the problem.
jhowell is offline   Reply With Quote
Old 06-09-2021, 11:56 AM   #1264
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: 13,442
Karma: 65505905
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by jhowell View Post
I have updated "disable k4pc download.bat" in the first post of this thread with your changes.

Hopefully someone will try it and report back on whether or not it is effective at blocking updates when Kindle for PC is installed in the alternate location.
Hopefully, we should hear back.



Quote:
Originally Posted by jhowell View Post
That line exists to fix the damage done by a bug in the original version of the script which was available for a short time. That bad version replaced the wrong folder, leaving Kindle for PC non-functional. Anyone who ran that bad script can run a newer version to correct the problem.
I must have missed that issue. Thanks for the information.
DNSB is offline   Reply With Quote
Old 06-10-2021, 03:02 PM   #1265
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: 13,442
Karma: 65505905
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
After a PMmed request, I made the same modification to the batch file to start Kindle4PC while blocking KFX downloads that was made to the block updates batch file so the Kindle4PC executable will be started from either the normal or the admin install default locations.

Spoiler:
Code:
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
Attached Files
File Type: bat kindle_noKFX.bat (1.4 KB, 12 views)

Last edited by DNSB; 06-10-2021 at 03:07 PM.
DNSB is offline   Reply With Quote
Old Yesterday, 01:54 AM   #1266
Manolis
Junior Member
Manolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipseManolis can illuminate an eclipse
 
Posts: 2
Karma: 8234
Join Date: Jul 2017
Device: Kindle
Just for the record, in order to cope with very occasional unstoppable updates on my Mac, I made a zipped copy of Kindle.app and left it in the Applications folder. When Kindle.app gets updated, I simply delete it then unzip a copy of the old version.
Manolis is offline   Reply With Quote
Old Yesterday, 05:00 AM   #1267
lkmiller
Laura
lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.lkmiller ought to be getting tired of karma fortunes by now.
 
lkmiller's Avatar
 
Posts: 958
Karma: 10974894
Join Date: Nov 2009
Device: Kobo Forma, Nook Glowlight Plus 7.8", Kindle Oasis 2, Onyx T68 Lynx
Are you still getting updates with your updates folder set to read only or with a blank no extension txt file named updates?
lkmiller is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Handling KFX files in Calibre HarryT Conversion 53 08-31-2018 03:21 AM
Dealing with Kindle for PC/Mac 1.19 and KFX in calibre BetterRed Conversion 0 02-08-2017 12:47 PM
Dealing with Kindle for PC/Mac 1.19 and KFX in calibre BetterRed Devices 0 02-06-2017 06:59 PM
updated calibre with a little help for kfx format cvkemp Amazon Kindle 0 10-06-2015 10:08 AM
Dealing with Multiple Calibre libraries samoanbiscuit Calibre Companion 4 08-27-2014 09:35 AM


All times are GMT -4. The time now is 01:41 PM.


MobileRead.com is a privately owned, operated and funded community.