GearHeads Corner
May 30, 2020, 06:08:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: run dos bat file or cmd line (os shell) from auggie script  (Read 581 times)
0 Members and 1 Guest are viewing this topic.
Richard Cullin
Full Member
***
Posts: 152


View Profile
« on: September 22, 2019, 09:28:54 PM »

i have been playing around reprogram ming sonoff  wifi switches to operate at my beck and call. it occurred to me that it would be a nice way to control
pumps, compresso rs exhaust fans  etc from auggie without the need for any physical connectio n.
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 ?


Logged
Richard Cullin
Full Member
***
Posts: 152


View Profile
« Reply #1 on: September 23, 2019, 12:52:11 AM »

tried Exec, Execute , got nothing except the print message

Code:

global AirButton = function()
{
 
 
print("airblow toggle");
Exec("c:\ctwin\s5.bat");
    yield();
 
return;
};
 
Logged
Ya-Nvr-No
Moderator
Full Member
*****
Posts: 220



View Profile WWW
« Reply #2 on: September 23, 2019, 07:52:46 AM »

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

try this:
system.Ex ec("c:\ctwin\s5.bat");
Logged

ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #3 on: September 23, 2019, 08:17:42 AM »

YaNvrNo:

  Good thing you remembere d that, I knew there was something we added but couldnt
quite remember what.. Smiley

Art
Logged
Richard Cullin
Full Member
***
Posts: 152


View Profile
« Reply #4 on: September 23, 2019, 10:03:03 AM »

system.Ex ec("Notepad "

notepad works ok. but not my wget.exe ,  i will try locating it in the "PATH"
in the morning , its late here pumpkins everywher e
Logged
Richard Cullin
Full Member
***
Posts: 152


View Profile
« Reply #5 on: September 23, 2019, 04:35:20 PM »


thanks , works perfectly when executabl e 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:
global AirButton = function()
{
print("airblow toggle");
system.Exec("sfk udpsend sonoff5:9889 {\"switch\":2}" );
    yield();
return;
};
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!