Launching a batch file from Adobe AIR 2.0

208 views
Skip to first unread message

Kronos

unread,
May 24, 2011, 8:03:46 AM5/24/11
to Flex India Community
Hi,

I have been trying to launch a batch file from my Adobe AIR
application. I have followed the code sample provided in this link
http://forums.adobe.com/thread/662058?decorator=print&displayFullThread=true
However my code does not invoke the batch file while the author of the
post claims his does.
Here's a sample of my code.

var executable:File = new File("C:\\WINDOWS\\system32\\cmd.exe");
var bat:File = new File("D:\\Utkarsh\\Hello.bat");

var nativeProcess:NativeProcess = new NativeProcess();

if (NativeProcess.isSupported)
{
trace("Native Process Supported");
}

var args:Vector.<String> = new Vector.<String>();
args.push("/c",bat.nativePath);

var nativeProcessStartupInfo:NativeProcessStartupInfo = new
NativeProcessStartupInfo();

nativeProcessStartupInfo.executable = executable;
nativeProcessStartupInfo.arguments = args;

nativeProcess.addEventListener(NativeProcessExitEvent.EXIT,
onExitError );

Flexian_me

unread,
May 25, 2011, 1:06:28 AM5/25/11
to Flex India Community
Not having FB now so can't debug but make instance of NativeProcess
and add all handlers for NativeProcess event
as shown in referred URL, I am sure you will get to know the problem.

On May 24, 5:03 pm, Kronos <utkars...@gmail.com> wrote:
> Hi,
>
> I have been trying to launch a batch file from my Adobe AIR
> application. I have followed the code sample provided in this linkhttp://forums.adobe.com/thread/662058?decorator=print&displayFullThre...

patrick sewera

unread,
Jun 14, 2011, 5:49:24 AM6/14/11
to flex_...@googlegroups.com
Hi Kronos
  • Ensure you use The Extended desktop profile available in Air 2
  • Use native installer
  • (For flash) Develop with CS5.5 for the least hassle
Reply all
Reply to author
Forward
0 new messages