1

[TeXstudio 2.10.4, Win7]
I would like to be able to run a custom CLI command (batch, script, or executable) after the document build process has completed. Since the build process is a chain of commands, I think I should be able to do this, but am confused by the tags used (like txs://compile) that are in the Configure TeXstudio -> Build screen.
Anyone able to suggest how to do this?

2

The tags txs:///... references commands. You can check the tag of a command in it's tooltip (see attached image). Just create a user command for your CLI command and add it to the compile command.

For further details see Section 1.3.1 Advanced configuration of the build system in the user manual.

(image updated)

enter image description here

  • Thanks Tim but its not quite working. Like your example, I'm also using a .vbs and I've configured my TeXstudio as per your diagram. However, I'm getting an Error: Could not start the command: ... message, similar to Jack, but since I'm using Win there is no need for a 'shebang'. I've added cscript into the command definition, but hasn't helped. Any ideas? – gone Jan 9 '16 at 19:34
  • I've also tried changing the characters / to \ and \\ , but it is still not working. – gone Jan 9 '16 at 19:51
  • I tried running an arbitrary, but benign executable and it worked. So I'm guessing it doesn't like .vbs scripts or doesn't know how to handle them and needs a wrapper. – gone Jan 9 '16 at 20:04
  • Fixed. Need to have "C:\Windows\System32\cscript.exe" before the vbs script path & name. Note that cscript must be enclosed in its own set of quotation marks. So the full command became: "C:\Windows\System32\cscript.exe" "C:\My Folder\my sub-folder\myscript.vbs". (Also, the slashes have to be the normal Win backshash \ .) – gone Jan 9 '16 at 20:31
  • If you want to pass parameters to your script, you need to format the command a little different. Use: cmd /C "C:\Windows\System32\cscript.exe myscript.vbs %". The % is a TeXstudio symbol for "filename of the root document for of current document without extension". – gone Mar 10 '16 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.