command to run a batch file

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
dilminha
Noob
Noob
Posts: 18
Joined: 13 Mar 2017, 12:01
Noob?: No

command to run a batch file

#1 Post 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

User avatar
SkylorD
Moderators
Moderators
Posts: 1167
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: command to run a batch file

#2 Post by SkylorD »

Download a fresh version of kore in github.
Learn rules

dilminha
Noob
Noob
Posts: 18
Joined: 13 Mar 2017, 12:01
Noob?: No

Re: command to run a batch file

#3 Post 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

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: command to run a batch file

#4 Post by Mortimal »

Cause latest kore only load plugins you specify in sys.txt
Please use pin function for uploading your file contents!

dilminha
Noob
Noob
Posts: 18
Joined: 13 Mar 2017, 12:01
Noob?: No

Re: command to run a batch file

#5 Post by dilminha »

ok now it load the plugin, but when I type runbat (with wxstart) it gives me this error:
korerror.PNG

dilminha
Noob
Noob
Posts: 18
Joined: 13 Mar 2017, 12:01
Noob?: No

Re: command to run a batch file

#6 Post by dilminha »

can someone help please :)

Post Reply