locked
open 64-bit command from 32-bit application using _popen() function fails RRS feed

  • Question

  • Hi

    I want to create pipe and execute 64-bit command using my 32-bit application. But it fails to open 64-bit command and gives message as '.... is not recognized as an internal or external command,
    operable program or batch file'.

    But if I create 64-bit application, it works properly. I want to run 32-bit application.

    There is any way  to resolve this problem?

     

    Thank you.


    Raman
    Thursday, January 6, 2011 7:37 AM

Answers

  • Hi David,

    Thank you for your response

    I have given full path of exe in CreateProcess Function, I am given path as "c:/windows/system32/<exe>".

    After more searching I found that when you try to access system32 folder in 32-bit application on 64-bit machine, the path will be redirected to 'sysWOW64'.

    If you want to access files in system32, you need to stop redirecting.

    After stopping redirecting I am able to run exe present in system32 folder.

    Thank you.


    Raman
    • Marked as answer by Raman-SGGS Thursday, January 6, 2011 3:37 PM
    Thursday, January 6, 2011 3:36 PM

All replies

  • I am also facing problem while executing 64-bit application from 32-bit using ShellExecute function.

    The 64-bit application is present inside 'System32' folder.

    Hoe to solve this problem?


    Raman
    Thursday, January 6, 2011 9:53 AM
  • The previous version of this message suggested that the problem is in the setting of the PATH environment variable, but after reviewing the CreateProcess Function I suggest that you supply the full path to the executable to both _popen() and ShellExecute().


    Answering policy: see profile.

    • Edited by David Boyce UK Thursday, January 6, 2011 11:22 AM Revised suggestion
    Thursday, January 6, 2011 10:55 AM
  • Hi David,

    Thank you for your response

    I have given full path of exe in CreateProcess Function, I am given path as "c:/windows/system32/<exe>".

    After more searching I found that when you try to access system32 folder in 32-bit application on 64-bit machine, the path will be redirected to 'sysWOW64'.

    If you want to access files in system32, you need to stop redirecting.

    After stopping redirecting I am able to run exe present in system32 folder.

    Thank you.


    Raman
    • Marked as answer by Raman-SGGS Thursday, January 6, 2011 3:37 PM
    Thursday, January 6, 2011 3:36 PM
  • I am also facing similar problem. i didn't clearly understand your solution. i am trying to capture the netsh command output on a 64 bit machine using 32 bit process. few components(mbn) are not loading using 32bit folder(sysWOW64). So i wanted to use _popen() function which should consider netsh in system32 folder.

    So how to set scope for _popen()....

    Can somebody help on this.

    thanks

    venkat.


    Windows Desktop, Windows Phone developer.

    Friday, February 1, 2013 4:50 AM