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

  • Home
  • SEARCH
  • 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 8914755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:48:22+00:00 2026-06-15T04:48:22+00:00

I m using flex4.6 and i wanted to run a .bat file from ma

  • 0

I m using flex4.6 and i wanted to run a .bat file from ma air application, is there any help ?

  • 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-15T04:48:23+00:00Added an answer on June 15, 2026 at 4:48 am

    Try this

    This class might helpful for you my_command.bat echo “Hello Native Process”

    Before run applications (Projectname-app.xml) check supportedProfiles tag

    desktop extendedDesktop mobileDevice exendedMobileDevice

    to

    extendedDesktop

    package
    {
    
      import flash.desktop.NativeProcess;
    import flash.desktop.NativeProcessStartupInfo;
    import flash.events.ProgressEvent;
    import flash.filesystem.File;
    
    import mx.controls.Alert;
    
    public class PlatformPackaging
    {
        private var nativeProcess:NativeProcess;
        private var isErrorOccured:Boolean;
    
        private var batFile:File;
        private var cmdFile:File;
    
        private function get isWindows():Boolean
        {
            return true;
        }
    
        public function PlatformPackaging()
        {
        }
    
        public function start(targetPlatform:String):void
        {
            if(isWindows)
            {
                batFile = File.applicationDirectory.resolvePath("publish/my_command.bat");
                cmdFile = new File("c:\\Windows\\System32\\cmd.exe");
            } 
    
            proceedToPackaging();
        }
    
    
        private function proceedToPackaging():void {
    
            var processArgs:Vector.<String> = new Vector.<String>;
    
            processArgs.push("/c");
            processArgs.push(batFile.nativePath);
    
            var workingDirectory:File = File.applicationDirectory.resolvePath("publish/");
            var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
    
            nativeProcessStartupInfo.arguments = processArgs;
            nativeProcessStartupInfo.executable = cmdFile;
            nativeProcessStartupInfo.workingDirectory = workingDirectory;
    
            nativeProcess = new NativeProcess();
            nativeProcess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA,onStandardErrorOutputDataHandler);
            nativeProcess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA,onStandardOutputDataHandler);
            nativeProcess.start(nativeProcessStartupInfo);
        }
    
        private function onStandardErrorOutputDataHandler(event:ProgressEvent) : void
        {
            var certResponse:String = nativeProcess.standardError.readUTFBytes(nativeProcess.standardError.bytesAvailable);
    
            trace(certResponse);
            nativeProcess.removeEventListener(ProgressEvent.STANDARD_ERROR_DATA,onStandardOutputDataHandler);
            nativeProcess.exit();
        }
    
        Alert.show(certResponse,'Error');
    }
    
    protected function onStandardOutputDataHandler(event:ProgressEvent):void
    {
        var status:String = nativeProcess.standardOutput.readUTFBytes(nativeProcess.standardOutput.bytesAvailable);
    
        Alert.show(status)
    }
     }
    }
    

    Please let me know any clarification.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Flex4.5. When creating an AIR application and trying to export it,
working with Flex4 AIR app, using this component I get data from the barcode
I've recently started using flex4 and have found when I compile a file, the
i just wanted to update an AIR Application for a client. But when the
we are developing an Adobe AIR app using Flex4. We are facing lot of
I'm using the flexslider plugin and i wanted to know if there is an
In my Application using Flex-Blazeds-java...,in my Flex application side have two mxml file Main.mxml
I am simply trying to draw a rectangle inside of a panel using flex4.
I am using Flex with Flash player. I know with AIR i can access
I'm building from scratch a web application that is not trivial (have some algorithms

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.