SadBunny Posted June 11, 2015 Share Posted June 11, 2015 Are you sure? The user manual states clearly: Whenever you pass arguments to ebook-meta that have spaces in them, enclose the arguments in quotation marks. 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 The problem is space between "test" and " folder" in the path Link to comment Share on other sites More sharing options...
SadBunny Posted June 11, 2015 Share Posted June 11, 2015 I understand, but quoting the argument like that should be the solution to that problem. kisstom 1 Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
SadBunny Posted June 11, 2015 Share Posted June 11, 2015 Try running it with /k instead of /c, and @SW_SHOW instead of @SW_HIDE, so you can see the dos prompt window with possible error codes. 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 Try running it with /k instead of /c, and @SW_SHOW instead of @SW_HIDE, so you can see the dos prompt window with possible error codes.? Extactly what i did (@SW_SHOW not needed, /k enough), that's why i know the exe goes only to c:\test Link to comment Share on other sites More sharing options...
SadBunny Posted June 11, 2015 Share Posted June 11, 2015 Think I got it, after some googling. It's weird how cmd works with quoting its parameters. Try this:Run(@ComSpec & " /k """"" & @ScriptDir & "\Calibre\ebook-meta.exe"" ""c:\test folder\test.mobi"" --title TESTbook --authors somebody""""")Yes, all those quotes are necessary. I downloaded the program and tried it out myself. My actual command was:C:\tmp>cmd /c ""c:\Program Files\Calibre2\ebook-meta.exe" "c:\tmp\test dir\test file.mobi" --title TESTbook3 --authors somebody2""Hope I converted it to your paths correctly kisstom 1 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 OMG, so many quoting, i'll dream about them tonight! And we still not there if title or author contains space(s) Run(@ComSpec & " /k """"" & @ScriptDir & "\Calibre\ebook-meta.exe"" ""c:\test folder\test.mobi"" --title ""TEST és book"" --authors ""some body"" """"")Need space after body"" , otherwise the autor will be some body"Bu there is a new problem if i want to use a variable like this:$Path = "c:\test folder\test.mobi" Run(@ComSpec & " /k """"" & @ScriptDir & "\Calibre\ebook-meta.exe"" & "$Path" --title ""TEST és book"" --authors ""some body"" """"")Not working... Link to comment Share on other sites More sharing options...
SadBunny Posted June 11, 2015 Share Posted June 11, 2015 (edited) Believe it or not, but you used the quotes incorrectly (/edit: and you forgot to put a space between the exe and the path)Run(@ComSpec & " /k """"" & @ScriptDir & "\Calibre\ebook-meta.exe """ & $Path & """ --title ""TEST és book"" --authors ""some body""""")/edit 2: and you need five quotes at the end instead of seven. That way you don't need the space. 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...
SadBunny Posted June 11, 2015 Share Posted June 11, 2015 Pro tip: you don't need to quote the doublequote if you use single quotes to formulate your string.Run(@ComSpec & ' /k ""' & @ScriptDir & '\Calibre\ebook-meta.exe" "' & $Path & '" --title "TEST és book" --authors "some body""')Don't know why I didn't think of that hours ago, it obviously makes this a lot simpler kisstom 1 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 (edited) Believe it or not, but you used the quotes incorrectly (/edit: and you forgot to put a space between the exe and the path)Run(@ComSpec & " /k """"" & @ScriptDir & "\Calibre\ebook-meta.exe """ & $Path & """ --title ""TEST és book"" --authors ""some body"" """"") Not working But this working:Run(@ComSpec & ' /k ""' & @ScriptDir & '\Calibre\ebook-meta.exe" "' & $Path & '" --title "TEST és book" --authors "some body""')Did you find a tutorial how this syntax working?I really do not understand but i made another variable to work $Path = "c:\test folder\test.mobi" $Title = "TEST és book" Run(@ComSpec & ' /k ""' & @ScriptDir & '\Calibre\ebook-meta.exe" "' & $Path & '" --title "' & $Title & '" --authors "some body""')Edit: I just implement this into my program and it's working.Thank you Edited June 11, 2015 by kisstom 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