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
mariovde

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 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 System SpecsSystem Spec
.
01 Apr 2012   #2
Ztruker

Windows 10 Pro 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
mariovde

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
Ztruker

Windows 10 Pro X64
 
 

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

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
Ztruker

Windows 10 Pro 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
mariovde

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
Ztruker

Windows 10 Pro 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
vsrawat

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
Thread Forum
netsh wlan show profiles: Access is denied
If I try to run the command: netsh wlan show profiles even if I run the command prompt with administrative privileges, I receive back: Function WlanGetProfileList returns error 5: Access is denied. Any help would be much appreciated, thanks.
Network & Sharing
Force an IP to a MAC on virtual network (using netsh wlan command)
Hi I'm creating as virtual network on my PC using netsh wlan commands and it's working great. However, at this point a need came to me to force a particular IP to a MAC address. Ofcourse it will be an IP that is allowed. All I need is to force a connecting device (with a static MAC) to have the...
Network & Sharing
what is the windows 7 form of this netsh command?
netsh fire ad porto tcp 134 p134 ENABLE SUBNET I want to open port 134, TCP, for local subnet. it's incoming so for a server running on port 134. and only my LAN should have access.
System Security
netsh renew file not found
I have been having a problem with my comp that won't connect to the net. I did'n t have firewall but fixed that but still unidentified network error. I have dl'd fixes to restore network/internet connectivity but nothing works I think it might be winsock error. Any help would be appreciated.
Network & Sharing
netsh advfirewall add- how to prevent multiple entries by command line
Hi Im using a little script to enter "add rule" to the firewall in Win 7 f.e. netsh advfirewall firewall add rule name="Firefox Updater" dir=out program="%ProgramFiles% (x86)\Mozilla Firefox\updater.exe" enable=yes profile=any action=allow This works fine so far. But if i start the...
System Security
search results doesn't show file contents found and not highlighted
see how in this picture: http://res2.windows.microsoft.com/resbox/en/Windows%207/main/1/5/15a33ccd-64a6-48d0-b63e-5610ab536484/15a33ccd-64a6-48d0-b63e-5610ab536484.jpg in the search results, if the searched word is found inside a file, a few lines of text are show with the word highlighted. ...
General Discussion


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 12:21.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App