os.execute
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

os.execute

Started by sphinx_spb, 03 June, 2009, 07:00:46

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sphinx_spb

os.execute("cmd /c start /MIN "..path.."/bmail.cmd")


This exactly code doing fine on 0.4.1.1 GUI version but not on service version.
Tested on two hubs with same config.
It seems that service version can't do os.execute at all.
System is:  Microsoft(R) Windows(R) Server 2003, Enterprise Edition 5.2.3790 Service Pack 2 build 3790
How could it be solved?

sphinx_spb

Damn these slashes! Move slash to path variable and it works.
BTW, another bug - OnError always returns C:\ptokax\scripts path, no matter where are real files.

sphinx_spb

I mean OnError=function always returns
Error C:\ptokax\scripts\*scriptname*.lua

But my hub is on E:\

sphinx_spb

#3
I see I'm bad explainer...

1) os.execute issue was solved by moving slash (but strange why this not needed in GUI version)
So this code not works in service (but works in GUI):
path=Core.GetPtokaXPath().."scripts"
os.execute("cmd /c start /MIN "..path.."/bmail.cmd")


and this works in both:
path=Core.GetPtokaXPath().."scripts/"
os.execute("cmd /c start /MIN "..path.."bmail.cmd")


2) And then I reported another issue:

OnError=function(msg)
	local admin = "sphinx"
	if admin then Core.SendPmToUser(admin,BOTNAME,msg) end
end

My hub is on E:\Bla1\Bla2\ so on... no matter where is it located, errors (if any) are ALWAYS reported like this: Syntax C:\ptokax\scripts\myscript.lua:777:bla-bla-bla. But again, this issue isn't occur in GUI version.

SMF spam blocked by CleanTalk