Jump to content

[Solved] commandline exe tools


Recommended Posts

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

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 :)

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

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

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 by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

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 :)

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

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 :ermm:

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 by kisstom
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...