kisstom Posted June 6, 2015 Share Posted June 6, 2015 (edited) Hi, i would liket to use an ebook related commandline tool 'ebook-meta.exe'. It's in the Calibre subfolder (relative to the script). I wrote a program:Run("cmd.exe") Sleep(500) Send('cd Calibre' & "{Enter}") ; go to Calibre subfolder Sleep(250) Send('ebook-meta.exe c:\test.mobi --title TESTbook --authors somebody' & "{Enter}")Works well but i know it's not an elegant way. It would be the best the cmd window not show up at all or at least close when the exe doneI tryed to use run or runwait with no luck, i don't know how to use the parameters (--title ). Edited June 12, 2015 by kisstom Link to comment Share on other sites More sharing options...
l3ill Posted June 6, 2015 Share Posted June 6, 2015 Probably going to look more like this:RunWait(@ComSpec & " /cd Calibre/ebook-meta.exe " & "c:\test.mobi --title TESTbook --authors somebody) https://www.autoitscript.com/wiki/Snippets_(_CMD_) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
jguinch Posted June 6, 2015 Share Posted June 6, 2015 @l3ill : what is this /cd parameter ??Try this :Run(@ComSpec & " /c ebook-meta.exe c:\test.mobi --title TESTbook --authors somebody", "Calibre") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
l3ill Posted June 6, 2015 Share Posted June 6, 2015 My bad...been awhile BTW if you dont want the dos window to be seen use:Run(@ComSpec & " /c " & "command","", @SW_HIDE) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
l3ill Posted June 6, 2015 Share Posted June 6, 2015 @l3ill : what is this /cd parameter ??Try this :Run(@ComSpec & " /c ebook-meta.exe c:\test.mobi --title TESTbook --authors somebody", "Calibre") Many many years ago it was Change Directory My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
jguinch Posted June 6, 2015 Share Posted June 6, 2015 Maybe you meant cmd /c cd Calibre & ebook-meta.exe c:\test.mobi --title TESTbook --authors somebody? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
kisstom Posted June 7, 2015 Author Share Posted June 7, 2015 Sorry guys none of this working... I tryed a lot of similar stuff without luck. I also know the @SW_HIDE parameter but i can't go so far CD means change directory so the full path of the exe: @ScriptDir & "Calibre\ebook-meta.exe"It needs a lot of DLLs and others so i put them a separate folder. Link to comment Share on other sites More sharing options...
kisstom Posted June 10, 2015 Author Share Posted June 10, 2015 Really a surprise this is so diffcult. I made some progress, working with this syntax:Run(@ComSpec & " /k" & @ScriptDir & "\Calibre\ebook-meta.exe c:\test.mobi --title TESTbook --authors somebody")But only if the script path NOT contain space(s). The run function help says: 'Paths with spaces need to be enclosed in quotation marks'But how can i do this? '@ScriptDir' and "@ScriptDir" not working...Any idea? Link to comment Share on other sites More sharing options...
Exit Posted June 10, 2015 Share Posted June 10, 2015 (edited) ?Run(@ComSpec & " /k """ & @ScriptDir & "\Calibre\ebook-meta.exe""" & " c:\test.mobi --title TESTbook --authors somebody") Edited June 10, 2015 by Exit kisstom 1 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Jewtus Posted June 10, 2015 Share Posted June 10, 2015 Well, I think you are pathing incorrectly. Try this: $ebook_meta='Full path to exe' $CalibreDIR='Full path to calibre dir' RunWait('"' & @ComSpec & '" /c '&$ebook_meta&' c:\test.mobi --title TESTbook --authors somebody"', $CalibreDIR, @SW_HIDE) Link to comment Share on other sites More sharing options...
kisstom Posted June 10, 2015 Author Share Posted June 10, 2015 ?Run(@ComSpec & " /k """ & @ScriptDir & "\Calibre\ebook-meta.exe""" & " c:\test.mobi --title TESTbook --authors somebody") Madness Need to be enclosed in quotation marks the FULL path, not just "@Scriptdir", Thank you Exit Link to comment Share on other sites More sharing options...
TheSaint Posted June 10, 2015 Share Posted June 10, 2015 (edited) @ComSpec stuff can be a little tricky, because it needs to be exactly correct in most instances.Jewtus almost got it right. @ComSpec does not need wrapping in quotes. $CalibreDIR shouldn't need them either.If TESTbook is a path, that will probably need wrapping in quotes too, especially where spaces exist.RunWait(@ComSpec & ' /c "' & $ebook_meta & '" c:\test.mobi --title TESTbook --authors somebody', $CalibreDIR, @SW_HIDE)If you use /k instead of /c while testing (and without @SW_HIDE), you will see if errors occur.NOTE - As it is, c:\test.mobi, doesn't need quotes, but it might if it changed to something else.RunWait(@ComSpec & ' /c "' & $ebook_meta & '" "c:\test.mobi" --title TESTbook --authors somebody', $CalibreDIR, @SW_HIDE) Edited June 10, 2015 by TheSaint greater clarity Jewtus 1 Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
kisstom Posted June 10, 2015 Author Share Posted June 10, 2015 Run(@ComSpec & " /c """ & @ScriptDir & "\Calibre\ebook-meta.exe""" & " c:\test.mobi --title TESTbook --authors somebody","",@SW_HIDE)This line does exactly what i want Thank you for the help guys Link to comment Share on other sites More sharing options...
TheSaint Posted June 10, 2015 Share Posted June 10, 2015 You should really use single quotes (') to quote double quotes (") and vice-a-versa. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
kisstom Posted June 11, 2015 Author Share Posted June 11, 2015 Can i mark this topic [Solved] ? Link to comment Share on other sites More sharing options...
Exit Posted June 11, 2015 Share Posted June 11, 2015 (edited) Yes, just click the best answer. Edited June 11, 2015 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Jewtus Posted June 11, 2015 Share Posted June 11, 2015 exit, solve isn't on this version of the boards... What I have been doing is editing my first post and changing the thread name to [Solved] - {original thread name} Link to comment Share on other sites More sharing options...
kisstom Posted June 11, 2015 Author Share Posted June 11, 2015 Unfortunatelly not soved yetStill have troluble with space(s) if there is in the 'test.mobi' path:Run(@ComSpec & " /k """ & @ScriptDir & "\Calibre\ebook-meta.exe""" & " c:\test folder\test.mobi --title TESTbook --authors somebody")i getting error if enclosed in quotation marks the full stuff Link to comment Share on other sites More sharing options...
SadBunny Posted June 11, 2015 Share Posted June 11, 2015 (edited) So... Quote that as well Run(@ComSpec & " /k """ & @ScriptDir & "\Calibre\ebook-meta.exe"" ""c:\test folder\test.mobi"" --title TESTbook --authors somebody") Edited June 11, 2015 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
kisstom Posted June 11, 2015 Author Share Posted June 11, 2015 So... Quote that as well Run(@ComSpec & " /k """ & @ScriptDir & "\Calibre\ebook-meta.exe"" ""c:\test folder\test.mobi"" --title TESTbook --authors somebody") Tryed, not working... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now