Page 1 of 1

command to run a batch file

Posted: 17 Mar 2017, 15:12
by dilminha
I'm trying to write a plugin (a console command actually) to run a batch file, this is what I tried so far:



Code: Select all

# ===========================================
# = Console command that runs a batch file  =
# ===========================================



package runbat;

use strict;
use plugins;

Plugins::register("runbat","Runs a batch file",\&Unload,\&Reload);
my $commands = Commands::register(['runbat','run a batch file',\&cmdRunbat]);


sub Reload {


}

sub Unload { 


	

}

sub cmdRunbat {

system('start teste.bat');


}




1;
when I type runbat on console it opens another windows with an error:
error.PNG

Re: command to run a batch file

Posted: 19 Mar 2017, 18:48
by SkylorD
Download a fresh version of kore in github.

Re: command to run a batch file

Posted: 27 Mar 2017, 16:39
by dilminha
I've downloaded the newer openkore and now it not even load the plugin, I just copied the file runbat.pl to the plugins folder

Re: command to run a batch file

Posted: 28 Mar 2017, 01:36
by Mortimal
Cause latest kore only load plugins you specify in sys.txt

Re: command to run a batch file

Posted: 28 Mar 2017, 14:58
by dilminha
ok now it load the plugin, but when I type runbat (with wxstart) it gives me this error:
korerror.PNG

Re: command to run a batch file

Posted: 03 May 2017, 23:24
by dilminha
can someone help please :)