1

I try to call a system program from my C++ program, with administrator, but i get only this message "Operation not allowed in WOW64". I have tried the following codes:

system("netsh.exe interface ipv6 add v6v4tunnel IP6Tunnel 192.168.1.2 216.66.84.42");

or

CreateProcess(NULL, "netsh.exe interface ipv6 add v6v4tunnel IP6Tunnel 192.168.1.2 216.66.84.42", NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo)

and

ShellExecute(NULL, "runas", "netsh.exe interface ipv6 add v6v4tunnel IP6Tunnel 192.168.1.2 216.66.84.42", "", NULL, SW_SHOW);

if i call in an command line, it works

netsh.exe interface ipv6 add v6v4tunnel IP6Tunnel 192.168.1.2 216.66.84.42

What can I do to run a system command from my C++ program.

Why can't I compare C++ System(), CreateProcess() and ShellExecute() with start in a normal command line?

McGarnagle
  • 101,349
  • 31
  • 229
  • 260
  • I'm guessing because the command line is actual 64-bit and not WOW64 (ie 32-bit). Try compiling your app as 64-bit ... – Goz Nov 05 '12 at 22:18
  • _Guess_: build your C++ application as 64-bit binary. – hmjd Nov 05 '12 at 22:18

1 Answers1

1

What "WOW64" means is "Windows on Windows 64" or it's the emulator for 32-bit applications. It looks like you're trying to run a 64-bit process from a 32-bit program (or perhaps vice-versa)