netsh mbn show interfaces results in command not found on Win7 64Bit


  1. Posts : 7
    Win XP
       #1

    netsh mbn show interfaces results in command not found on Win7 64Bit


    Hi,

    I'm trying to run "netsh mbn show interfaces" from a .bat or .jar file on a Win7 64bit system but every time I run my file, it results in "The following command was not found mbn show interfaces".

    When I run that same command in a cmd.exe prompt, the result is correct and as expected.
    When we run /? we see "mbn" in available commands. When we output that same result from a .bat or .jar, we don't see that "mbn" command in the available commands for netsh.

    Anybody know what's happening?
    We know there are 2 netsh.exe files, one in sys32 and one in syswow64.

    All help is appreciated.

    Regards

    Mario
      My Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

    Does it work if you use C:\Windows\System32\netsh.exe when running from a .bat file?

    Try doing a cmd /k echo %path% from a .bat file and see what the path environment variable is set to. Make sure C:\Windows\System32 is in the path and the path is not corrupted.
      My Computer


  3. Posts : 7
    Win XP
    Thread Starter
       #3

    Everything points to the system32 folder...
    calling the netsh with a full path makes no difference.
    Some features are available, others are not.
      My Computer


  4. Posts : 6,285
    Windows 10 Pro X64
       #4

    What did cmd /k echo %path% from a .bat file show?
      My Computer


  5. Posts : 7
    Win XP
    Thread Starter
       #5

    the output on the device was:

    C:\Windows\system32;
    C:\Windows;
    C:\Windows\System32\Wbem;
    C:\Windows\System32\WindowsPowerShell\v1.0\;
    C:\PROGRA~1\DISKEE~1\DISKEE~1\;
    C:\Program Files (x86)\Toshiba\Bluetooth Toshiba Stack\sys\;
    C:\Program Files (x86)\Toshiba\Bluetooth Toshiba Stack\sys\x64\;
    C:\Program Files (x86)\Intel\Services\IPT\;
    C:\Program Files\Intel\WiFi\bin\;
    C:\Program Files\Common Files\Intel\WirelessCommon\;
    C:\Program Files\Intel\MCA\Bin;
      My Computer


  6. Posts : 6,285
    Windows 10 Pro X64
       #6

    The beginning of your path looks like mine.

    What is C:\PROGRA~1\DISKEE~1\DISKEE~1\ ????

    How are you calling the bat file? A link on the desktop or some other way?
      My Computer


  7. Posts : 7
    Win XP
    Thread Starter
       #7

    we solved the problem:

    When running the command "netsh mbn show interface" was running the cmd as a 64bit operation.
    When running the command from an application - that is 32bit - the cmd is run as a 32bit operation. And the mbn-context is not available in 32bit.

    In a windows 64bit os, a behind the scenes function exists: file system redirection.
    Meaning: a 64bit process will call the equivalent 32bit process.

    The workaround is that you use a csharp script or something else where you can override the file system redirection:

    IntPtr ptr = IntPtr.Zero;
    Wow64DisableWow64FsRedirection(ref ptr);
    <your proces information here>
    Wow64RevertWow64FsRedirection(ptr);
    //always revert the operation.

    and that solved it!
      My Computer


  8. Posts : 6,285
    Windows 10 Pro X64
       #8

    Glad to hear you found a solution. Where did you find this info? It sounds a bit strange to me, so I'd like to read up on it a bit if I can.

    Thanks
      My Computer


  9. Posts : 27
    Windows 7 Ultimate x86/x64 dual boot
       #9

    mariovde said:
    we solved the problem:

    When running the command "netsh mbn show interface" was running the cmd as a 64bit operation.
    When running the command from an application - that is 32bit - the cmd is run as a 32bit operation. And the mbn-context is not available in 32bit.

    In a windows 64bit os, a behind the scenes function exists: file system redirection.
    Meaning: a 64bit process will call the equivalent 32bit process.

    The workaround is that you use a csharp script or something else where you can override the file system redirection:

    IntPtr ptr = IntPtr.Zero;
    Wow64DisableWow64FsRedirection(ref ptr);
    <your proces information here>
    Wow64RevertWow64FsRedirection(ptr);
    //always revert the operation.

    and that solved it!
    And how do I compile the c# script, and run from a bat file?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:43.
Find Us