run dos bat file or cmd line (os shell) from auggie script

Discussions and file drops for Auggie
Post Reply
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

run dos bat file or cmd line (os shell) from auggie script

Post by Richard Cullin »

i have been playing around reprogramming sonoff  wifi switches to operate at my beck and call. it occurred to me that it would be a nice way to control
pumps, compressors exhaust fans  etc from auggie without the need for any physical connection.
i can use the command line utility wget.exe
{wget "http://10.0.0.131/st?sw=4" } to send a command to the sonoff

can auggie script run an os shell ?


Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: run dos bat file or cmd line (os shell) from auggie script

Post by Richard Cullin »

tried Exec, Execute , got nothing except the print message

Code: Select all

 
global	AirButton = function()
{
 
 
print("airblow toggle"); 
Exec("c:\ctwin\s5.bat");
    yield();
 
return;
};
 
Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: run dos bat file or cmd line (os shell) from auggie script

Post by Ya-Nvr-No »

found some examples:
system.Exec(path+file);
system.Exec("Notepad " + path + file);

try this:
system.Exec("c:\ctwin\s5.bat");
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: run dos bat file or cmd line (os shell) from auggie script

Post by ArtF »

YaNvrNo:

  Good thing you remembered that, I knew there was something we added but couldnt
quite remember what.. :)

Art
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: run dos bat file or cmd line (os shell) from auggie script

Post by Richard Cullin »

system.Exec("Notepad "

notepad works ok. but not my wget.exe ,  i will try locating it in the "PATH"
in the morning , its late here pumpkins everywhere
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: run dos bat file or cmd line (os shell) from auggie script

Post by Richard Cullin »


thanks , works perfectly when executable is in the system PATH

I can now send this json udp packet to my sonoff switch and turn the exhaust duct fan on/off for the laser fume extractor
from the auggie console 

Code: Select all

 global	AirButton = function()
{ 
print("airblow toggle"); 
system.Exec("sfk udpsend sonoff5:9889 {\"switch\":2}" );
    yield(); 
return;
};
Post Reply

Who is online

Users browsing this forum: No registered users and 72 guests