2-Way

2-Way SearchSearch
Author Message
Dmitry
New member
Username: Dim

Post Number: 3
Registered: 04-2004
Posted on Thursday, April 22, 2004 - 12:47 am:   

I was testing 2-Way and, having no cgi scripts, tried to start Winamp as an example of 2-Way command, but it doesn't start.
When I made a .bat file (attached) processing @@ variables and marked "Command returns response text", I got the following sms:
"Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

F:\WINDOWS\system32>"
I was starting the .bat file with full path and full path to cmd.exe:
f:\windows\system32\cmd.exe f:\smsvas.bat @@RECIP@@ @@SENDER@@ @@SMSPREFIX@@ @@SMS@@ @@FULLSMS@@

smsvas.bat attached below:
application/octet-stream
smsvas.bat (0.1 k)
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2359
Registered: 10-2002
Posted on Thursday, April 22, 2004 - 05:40 pm:   

Hi Dmitry,

NowSMS runs as a service. A 2-way command cannot launch a program to the desktop, as the 2-way commands are processed in the context of a service account.

To launch a batch file through CMD.EXE, you need to include a "/c" parameter after cmd.exe, as this tells cmd.exe to exit after processing the command. (Otherwise, it launches a new command processor and does not execute the command.)

Take a closer look at our ECHO example in the following link:

http://www.nowsms.com/documentation/ProductDocumentation/2_way_sms_support.htm

Your SMSVAS.BAT should work fine if you add the "/c" parameter to cmd.exe. I just would strongly recommend that you remove the "pause" as cmd.exe is not being run from the desktop, it is running in a service context.

Change your 2-way command to this string:

f:\windows\system32\cmd.exe /c f:\smsvas.bat @@RECIP@@ @@SENDER@@ @@SMSPREFIX@@ @@SMS@@ @@FULLSMS@@