2-Way | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through May 12, 2004 ⬆ |
◄ ► |
Author | Message | ||||
Dmitry New member Username: Dim Post Number: 3 Registered: 04-2004 |
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:
| ||||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 2359 Registered: 10-2002 |
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@@ |