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 08-12-2017, 08:31 AM   #1
skipster10
Member
skipster10 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2013
Device: iPad Air 2
3.6 Save to Disk Pops Debugging Command Window

In 3.6, If I choose several books and Save To Disk in a Single Directory, a Command Window pops open with "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Apps - General\calibre 64bit - E-book Management>rem Src: https://stackoverflow.com/questions/5185030/drag-and-drop-batch-file-for-multiple-files/5192427#5192427" and awaits "Press any key...".
skipster10 is offline   Reply With Quote
Advert
Old 08-12-2017, 08:51 AM   #2
skipster10
Member
skipster10 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2013
Device: iPad Air 2
Solved - Does this Indicate a Bug in Calibre?

I fixed this by deleting a script that I had created in "C:\Users\Username\Downloads\Test.bat" that contained the line "rem Src: https://stackoverflow.com/questions/5185030/drag-and-drop-batch-file-for-multiple-files/5192427#5192427". Note that I was Saving to Disk in a Single Directory "C:\Users\Username\Downloads\Test" when that command window popped open.

Why would saving books to directory "C:\Users\Username\Downloads\Test" cause execution of a batch file at "C:\Users\Username\Downloads\Test.bat"?
skipster10 is offline   Reply With Quote
Old 08-13-2017, 02:32 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 31,308
Karma: 8154029
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre most definitely does not execute anything when saving books to disk.
kovidgoyal is offline   Reply With Quote
Old 08-14-2017, 10:07 AM   #4
skipster10
Member
skipster10 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2013
Device: iPad Air 2
I was able to recreate the behavior. I created C:\Users\Username\Downloads\test.bat whose contents were:

REM 12345
PAUSE

I then Saved to Disk in a Single Directory and selected the "C:\Users\Username\Downloads\Test" folder.

After the books are saved to disk, I get a Command Window with:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Apps - General\calibre 64bit - E-book Management>rem 12345

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Apps - General\calibre 64bit - E-book Management>PAUSE
Press any key to continue . . .
skipster10 is offline   Reply With Quote
Old 08-14-2017, 10:37 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 31,308
Karma: 8154029
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Saving to disk opens the target folder after saving. Which is done by passing the folder path to windows. Since you have a test.bat file and test folder, when calibre asks windows to open the folder it executes the bat file instead, which presumably happens because microsoft thought it a good idea to execute files with .exe/.bat and .cmd extensions even when the full filename with extension is not supplied. Given that microsoft also thought having magic filenames in their filesystems sunch as NUL and COM was a good idea, I'm not surprised.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-14-2017, 10:49 AM   #6
skipster10
Member
skipster10 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2013
Device: iPad Air 2
Thank you for the explanation. Now it makes sense.
skipster10 is offline   Reply With Quote
Old 08-15-2017, 12:14 AM   #7
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: 3,547
Karma: 12876400
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Aura One, Aura H2O, Aura HD, Nexus 7 HD, iPad Air
Quote:
Originally Posted by kovidgoyal View Post
Saving to disk opens the target folder after saving. Which is done by passing the folder path to windows. Since you have a test.bat file and test folder, when calibre asks windows to open the folder it executes the bat file instead, which presumably happens because microsoft thought it a good idea to execute files with .exe/.bat and .cmd extensions even when the full filename with extension is not supplied. Given that microsoft also thought having magic filenames in their filesystems sunch as NUL and COM was a good idea, I'm not surprised.
You really can't blame Microsoft for those reserved names since device special files were used long before Gates and Allen wrote their first line of code. You might place some blame on Gary Kildall and CP/M since CP/M's PIP program supported a number of special device names and QDOS (the ancestor of MS/PC-DOS) inherited them (hmmm.... perhaps pirated them might come closer ) but then we have to move back to DEC's RT-11 or OS/8 for their influence on Gary Kildall. Not so fond memories of RT-11 and dishwasher sized disk drives. Subtract One and Branch. Honestly, we weren't referring to management when we muttered that opcode.
DNSB is offline   Reply With Quote
Old 08-15-2017, 12:21 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 31,308
Karma: 8154029
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont blame microsoft, there were probably good reasons for it at the time, and their committment to backward compatibility is admirable. I'm just saying that given that the windows filesystem is full of these kinds of traps, it's not surprising to add one more to the list.
kovidgoyal 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
Debugging the screen Calenorn General Discussions 7 04-04-2017 02:56 PM
Spell Checker window on top of Editor window Calibre-Fan Editor 3 01-30-2016 11:48 AM
Opening a new window in calibre, and closing another window Dr. Drib Calibre 3 02-23-2012 09:27 AM
Debugging Password kaitorii enTourage Archive 4 11-14-2010 09:34 AM
iLiad Debugging and the iLiad scotty1024 iRex Developer's Corner 2 10-23-2006 03:43 PM


All times are GMT -4. The time now is 07:17 PM.


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