Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7762183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:19:51+00:00 2026-06-01T14:19:51+00:00

I want to pass two parameter to nativeProcess. While i am running exe file

  • 0

I want to pass two parameter to nativeProcess.

While i am running exe file using windows command with parameter, it is working.
Command for window is “abc.exe a.txt b.txt”

How can I pass two parameters to the exe in that format using flex nativeProcess?

This is what I have so far:

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="windowedapplication1_applicationCompleteHandler(event)">
    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;

            private var process:NativeProcess;
            protected function windowedapplication1_applicationCompleteHandler(event:FlexEvent):void
            {
                if (NativeProcess.isSupported)
                {
                    callExe();
                }
                else
                {
                    textReceived.text = "NativeProcess not supported.";
                }
            }

            public function callExe():void
            {
                var a_FilePath:String = File.applicationStorageDirectory.resolvePath("dist/a.txt").nativePath;
                var b_FilePath:File = File.applicationStorageDirectory.resolvePath("dist/b.txt").nativePath;

                if (Capabilities.os.toLowerCase().indexOf("win") > -1)
                {
                    var file:File = File.applicationStorageDirectory.resolvePath("dist/abc.exe");
                }

                var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();

// i put the line below and it works in my case

nativeProcessStartupInfo.workingDirectory = File.applicationStorageDirectory.resolvePath();

nativeProcessStartupInfo.executable = file;

                var args:Vector.<String> = new Vector.<String>();
                args.push(a_FilePath);
                args.push(b_FilePath);

                nativeProcessStartupInfo.arguments = args;

                process = new NativeProcess();
                process.start(nativeProcessStartupInfo);
                process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
                process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
                process.addEventListener(ProgressEvent.PROGRESS, progressEvent);
                process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, errorData);
            }

            public function inputProgressListener(event:ProgressEvent):void
            {
                textReceived.text += "Input Progress Event";
            }
            public function onOutputData(event:ProgressEvent):void
            {
                textReceived.text += "Output Event";
            }
            public function progressEvent(event:ProgressEvent):void
            {
                textReceived.text += "Progress Event";  
            }
            public function errorData(event:ProgressEvent):void
            {
                textReceived.text += "Error Event";
            }
        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>

    <mx:TextInput id="textReceived" width="352" height="200"/>

</s:WindowedApplication>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:19:53+00:00Added an answer on June 1, 2026 at 2:19 pm

    I solved my puzzle by adding the line below in bold:

    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="windowedapplication1_applicationCompleteHandler(event)">
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
    
                private var process:NativeProcess;
                protected function windowedapplication1_applicationCompleteHandler(event:FlexEvent):void
                {
                    if (NativeProcess.isSupported)
                    {
                        callExe();
                    }
                    else
                    {
                        textReceived.text = "NativeProcess not supported.";
                    }
                }
    
                public function callExe():void
                {
                    var a_FilePath:String = File.applicationStorageDirectory.resolvePath("dist/a.txt").nativePath;
                    var b_FilePath:File = File.applicationStorageDirectory.resolvePath("dist/b.txt").nativePath;
    
                    if (Capabilities.os.toLowerCase().indexOf("win") > -1)
                    {
                        var file:File = File.applicationStorageDirectory.resolvePath("dist/abc.exe");
                    }
    
                    var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
    

    // i put the line below and it works in my case

    nativeProcessStartupInfo.workingDirectory = File.applicationStorageDirectory.resolvePath();

    nativeProcessStartupInfo.executable = file;

                    var args:Vector.<String> = new Vector.<String>();
                    args.push(a_FilePath);
                    args.push(b_FilePath);
    
                    nativeProcessStartupInfo.arguments = args;
    
                    process = new NativeProcess();
                    process.start(nativeProcessStartupInfo);
                    process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
                    process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
                    process.addEventListener(ProgressEvent.PROGRESS, progressEvent);
                    process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, errorData);
                }
    
                public function inputProgressListener(event:ProgressEvent):void
                {
                    textReceived.text += "Input Progress Event";
                }
                public function onOutputData(event:ProgressEvent):void
                {
                    textReceived.text += "Output Event";
                }
                public function progressEvent(event:ProgressEvent):void
                {
                    textReceived.text += "Progress Event";  
                }
                public function errorData(event:ProgressEvent):void
                {
                    textReceived.text += "Error Event";
                }
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    
        <mx:TextInput id="textReceived" width="352" height="200"/>
    
    </s:WindowedApplication> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to pass two file path (for windows) to the script as command
i want to ask how to pass parameter between two classes in two different
I want to pass a parameter between two activities at a certain time interval.
I have two pages and I want to pass data to each other. How
i have two flex applications and i want to pass the data from one
I have two ListActivity classes that I want to pass into into a third
I Have two problem in this Case : I want to pass a JSON
I want to pass a few variables to another page. Currently I'm using response.redirect
I want to pass the parameter that List.sortBy takes through to another function. My
hello everyone i struggling to pass two parameter to an event handler basically when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.