tags:

views:

29

answers:

1

Hi

I have a Flex AIR2 application which uses native process to run CMD.exe. Application running fine on WinXP, Win R 2008 server. But not running on VISTA 64 bit OS.

Flex not able to run CMD.exe when application installed in C:\Program Files (x86). When I run application as Administrator mode it is working fine. Below is my code, I want to start cmd.exe as Administrator. My code :

var np:NativeProcess = new NativeProcess();
np.addEventListener(NativeProcessExitEvent.EXIT, done);
np.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutput);
np.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
np.addEventListener(Event.STANDARD_ERROR_CLOSE, error);    
var info:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var desktopPath :File = File.desktopDirectory;
var strdesktopPath :String = desktopPath.nativePath;
var pathArray :Array = strdesktopPath.split('\\'); 
var rootDrive :String = pathArray[0];     
//Geting Command prompt location
file.nativePath = rootDrive + "\\Windows\\system32\\cmd.exe";
info.executable = file;
var processArgs:Vector.<String> = new Vector.<String>();
info.arguments = processArgs;
np.start(info);    
A: 

http://blogs.adobe.com/simplicity/2010/06/air_2_nativeprocess_and_64_bit_windows.html

David Collie
Above link did not solve my problem. I want to run the cmd.exe as Administrator. It will solve my problem as I can use native process to run my .exe file and write output xml files in folder under program files.
FlexJogger