Extcommands on Windows

edited March 2018 in Questions & Answers
Hi all,

I just tried to run external commands on windows with no luck.

This is what I  tried:


If you want to run external commands, enter them in this configuration with
full path. You will see them in the main menu. Copy this file into the
<storage>/database directory.

Security consideration: The reason there is no online editor for this is simply
security. The commands you enter here are executed with the privileges of the
daemon running the server. If you would allow online configuration, a hacker could
simply add any command he needs to hack your system.

Commands are normally visible in the global menu. If you want one to appear only in
in the printer menu, add the attribute "slugname" to command. You see the slugname
when you select a printer as part of the path.
<name>run notepad</name>
<confirm>Really run notepad?</confirm>

<name>run c:\windows\notepad.exe</name>
<confirm>Really run c:\windows\notepad.exe?</confirm>

<name>run c:\\windows\\notepad.exe</name>
<confirm>Really run c:\\windows\\notepad.exe?</confirm>

G-code files can contain
@execute cmd param1 param2
commands. To prevent external users from executing unwanted or dangerous commands,
only commands defined here are allowed to execute. More over, only the shortcuts
defined here are to be used as cmd in @execute. Prevent parameter where ever possible.


All are recognized, so I can see them:

But you guess it, nothing happens if click on them. It's an old Windows XP machine, but that should not matter.

What am I doing wrong? Even the third one looks as it should work, as  I get this from the logs:

2018-03-09 09:46:31: Starting external command notepad with 0 parameters.
2018-03-09 09:46:34: Starting external command c:windowsnotepad.exe with 0 parameters.
2018-03-09 09:46:34: Handling action 'runExternalCommand' caused error System exception
2018-03-09 09:46:38: Starting external command c:\windows\notepad.exe with 0 parameters.



  • ok, I got it to run, starting notepad.exe was only ment for testing, it does not work. But now I can run PHP scripts, i.e. to send me Pushover Messages on certain events. This is the code I used:
    	<execute name="PushoverMessage" allowParams="true">c:\\php5\\php.exe c:\\skripte\\Repetier-Server\\pushover.php</execute>

    <name>Send PushoverMessage</name>
    <execute>c:\\php5\\php.exe c:\\skripte\\Repetier-Server\\pushover.php</execute>

    Both variations work for me now, so a command to send me a message on a finished print could look like this:

    @execute PushoverMessage "print finished"


Sign In or Register to comment.