Openkore.com

OpenKore Forums
It is currently 20 Apr 2018, 18:22

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: command to run a batch file
PostPosted: 17 Mar 2017, 15:12 
Offline
Noob
Noob

Joined: 13 Mar 2017, 12:01
Posts: 18
I'm trying to write a plugin (a console command actually) to run a batch file, this is what I tried so far:




Code:
# ===========================================
# = 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:

Attachment:
error.PNG
error.PNG [ 55.98 KiB | Viewed 1715 times ]


Top
 Profile  
 
 Post subject: Re: command to run a batch file
PostPosted: 19 Mar 2017, 18:48 
Offline
Moderators
Moderators
User avatar

Joined: 16 Dec 2011, 02:53
Posts: 1161
Location: Brazil
Download a fresh version of kore in github.

_________________
"'There are three things all wise men fear: the sea in storm, a night with no moon, and the anger of a gentle man.'" :P

Click here and travel to a new world -> Newbies
Read before asking something.
How to connect to private servers


Top
 Profile  
 
 Post subject: Re: command to run a batch file
PostPosted: 27 Mar 2017, 16:39 
Offline
Noob
Noob

Joined: 13 Mar 2017, 12:01
Posts: 18
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


Top
 Profile  
 
 Post subject: Re: command to run a batch file
PostPosted: 28 Mar 2017, 01:36 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
Cause latest kore only load plugins you specify in sys.txt

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
 Post subject: Re: command to run a batch file
PostPosted: 28 Mar 2017, 14:58 
Offline
Noob
Noob

Joined: 13 Mar 2017, 12:01
Posts: 18
ok now it load the plugin, but when I type runbat (with wxstart) it gives me this error:

Attachment:
korerror.PNG
korerror.PNG [ 23.92 KiB | Viewed 1504 times ]


Top
 Profile  
 
 Post subject: Re: command to run a batch file
PostPosted: 03 May 2017, 23:24 
Offline
Noob
Noob

Joined: 13 Mar 2017, 12:01
Posts: 18
can someone help please :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group