Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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


30 Mar 2012   #1

Win XP
 
 
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 Windows 7 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 System SpecsSystem Spec
.

01 Apr 2012   #2

Windows 8 Core X64
 
 

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 System SpecsSystem Spec
02 Apr 2012   #3

Win XP
 
 

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


03 Apr 2012   #4

Windows 8 Core X64
 
 

What did cmd /k echo %path% from a .bat file show?
My System SpecsSystem Spec
05 Apr 2012   #5

Win XP
 
 

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 System SpecsSystem Spec
05 Apr 2012   #6

Windows 8 Core X64
 
 

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 System SpecsSystem Spec
14 May 2012   #7

Win XP
 
 

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 System SpecsSystem Spec
16 May 2012   #8

Windows 8 Core X64
 
 

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 System SpecsSystem Spec
15 Nov 2012   #9

Windows 7 Ultimate x86/x64 dual boot
 
 

Quote   Quote: Originally Posted by mariovde View Post
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 System SpecsSystem Spec
Reply

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




Thread Tools



Similar help and support threads for2: netsh mbn show interfaces results in command not found on Win7 64Bit
Thread Forum
what is the windows 7 form of this netsh command? System Security
My Notepad suddenly can't Show Chinese Characters (win7 64bit)? General Discussion
netsh renew file not found Network & Sharing
netsh advfirewall add- how to prevent multiple entries by command line System Security
search results doesn't show file contents found and not highlighted General Discussion
Search Box Doesnt Show Results General Discussion
sfc/ scannow results show two 'cannot repair' files.. BSOD Help and Support

Our Sites

Site Links

About Us

Find 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 10:04 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33