command to run a batch file
Posted: 17 Mar 2017, 15:12
I'm trying to write a plugin (a console command actually) to run a batch file, this is what I tried so far:
when I type runbat on console it opens another windows with an error:
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;