[Windows] 使用 nvspbind 啟用網卡的 File and Printer Sharing for Microsoft Networks

[Windows] 使用 nvspbind 啟用網卡的 File and Printer Sharing for Microsoft Networks

今天專案遇到一個問題,需要在 Windows 上,

幫忙把 File and Printer Sharing for Microsoft Networks 打開:

Win7 SP1 en    

 

這個動作由人來做當然很簡單了,不過要用程式做?

還是來找找看別人寫的工具吧~~

找了半天,終於找到一個可以用的工具 Hyper-V Network VSP Bind (nvspbind)

來試試看吧~

 

參考資料:

How to enable “File and Printer Sharing for Microsoft Networks” on NIC with PowerShell

Announcing NVSPBind

MSDN: INetCfg

 

1. 下載 nvspbind

到 Hyper-V Network VSP Bind (nvspbind) 這個網頁,

中間可以看到三個附件:

  – 32bit_Nvspbind_package.EXE

  – Microsoft_Nvspbind_package.EXE

  – XP_Nvspbind_package.EXE

 

老實說不曉得上面幾個有什麼差別,我的 Windows 是 Windows 7,

隨便選了 32bit_Nvspbind_package.EXE 來下載~

下載後執行一下,會解出 nvspbind.exe 這個執行檔~

 

2. 執行 nvspbind 來設定 File and Printer Sharing

執行 nvspbind /? 看一下指令說明:

C:>nvspbind /?
Hyper-V Network VSP Bind Application 6.1.7690.0.
Copyright (c) Microsoft Corporation. All rights reserved.
Usage: nvspbind [option] [NIC|*] [protocol|*]
Options:
/n   display NIC information only
/u   unbind switch protocol from specified nic(s)
/b   bind switch protocol to specified nic(s)
/d   disable binding of specified protocol from specified nic(s)
/e   enable binding of specified protocol to specified nic(s)
/r   repair bindings on specified nic(s)
/o   show NIC order for specified protocol
/+   move specified NIC up in binding order for specified protocol
/-   move specified NIC down in binding order for specified protocol

 

它下面還有一堆指令的示範用法,參考一下之後,

就可以知道應該要怎麼用了~

像我想要停用所有網卡上的 File and Printer Sharing for Microsoft Networks,

就只要下 nvspbind /d * ms_server:

C:UsersAdministratorDesktop>nvspbind.exe /d * ms_server
Hyper-V Network VSP Bind Application 6.1.7725.0.
Copyright (c) Microsoft Corporation. All rights reserved.
acquiring write lock...success
Adapters:
{F4257682-2F79-43EB-B609-1A0B0FA8CD9C}
"*isatap"
"Microsoft ISATAP Adapter #2"
"isatap.tw.trendnet.org":
unbinding ms_server from Microsoft ISATAP Adapter #2
unbinding ms_server from Microsoft ISATAP Adapter #2
unbinding ms_server from Microsoft ISATAP Adapter #2
{EC0511C0-6DFC-4A38-9014-6889A8B4187A}
"*teredo"
"Teredo Tunneling Pseudo-Interface"
"Local Area Connection* 11":
unbinding ms_server from Teredo Tunneling Pseudo-Interface
unbinding ms_server from Teredo Tunneling Pseudo-Interface
unbinding ms_server from Teredo Tunneling Pseudo-Interface
{825DBBB5-C434-40E6-9778-11DCF480D3CF}
"*isatap"
"Microsoft ISATAP Adapter"
"Reusable ISATAP Interface {825DBBB5-C434-40E6-9778-11DCF480D3CF}":
unbinding ms_server from Microsoft ISATAP Adapter
unbinding ms_server from Microsoft ISATAP Adapter
unbinding ms_server from Microsoft ISATAP Adapter
{E0E0FECF-47D1-40CE-AC08-8D1E5AE1D359}
"pciven_8086&dev_100e&subsys_001e8086"
"Intel(R) PRO/1000 MT Desktop Adapter"
"Local Area Connection":
unbinding ms_server from Intel(R) PRO/1000 MT Desktop Adapter
unbinding ms_server from Intel(R) PRO/1000 MT Desktop Adapter
unbinding ms_server from Intel(R) PRO/1000 MT Desktop Adapter
unbinding ms_server from Intel(R) PRO/1000 MT Desktop Adapter
unbinding ms_server from Intel(R) PRO/1000 MT Desktop Adapter
unbinding ms_server from Intel(R) PRO/1000 MT Desktop Adapter
{DCB14C61-690D-46F7-8A89-150432FA5C44}
"ms_agilevpnminiport"
"WAN Miniport (IKEv2)"
"Local Area Connection* 2":
{E2F8A220-AF88-446C-9A55-453E58DD3A33}
"sw{eeab7790-c514-11d1-b42b-00805fc1270e}"
"RAS Async Adapter"
"Local Area Connection* 10":
{7C5653F0-144A-4534-9E34-28AC99CBA85E}
"ms_ndiswanip"
"WAN Miniport (IP)"
"Local Area Connection* 8":
{72DD97A9-E544-4915-88D8-44E829C34F68}
"ms_ndiswanbh"
"WAN Miniport (Network Monitor)"
"Local Area Connection* 7":
{F3229805-869E-479E-BA76-DD643F1D1B80}
"ms_ndiswanipv6"
"WAN Miniport (IPv6)"
"Local Area Connection* 6":
{DB2B4279-B5CF-4626-9DBA-32D0ECE44C87}
"ms_pppoeminiport"
"WAN Miniport (PPPOE)"
"Local Area Connection* 5":
{C0DE3E38-8BA7-479F-8B75-833F294C5AA8}
"ms_pptpminiport"
"WAN Miniport (PPTP)"
"Local Area Connection* 4":
{483C9FF8-503D-414B-B402-E4C1F1F568CB}
"ms_l2tpminiport"
"WAN Miniport (L2TP)"
"Local Area Connection* 3":
{E28D896F-9EA8-433A-9C10-66C97C19A921}
"ms_sstpminiport"
"WAN Miniport (SSTP)"
"Local Area Connection*":
applying changes...
cleaning up...releasing write lock...success
finished (0)

 

開網卡設定來看一下,File and Printer Sharing 真的變成停用了:

Win7 SP1 en  

 

要啟用的話,就執行 nvspbind.exe /e * ms_server 就行了:

C:UsersAdministratorDesktop>nvspbind.exe /e * ms_server
Hyper-V Network VSP Bind Application 6.1.7725.0.
Copyright (c) Microsoft Corporation. All rights reserved.
acquiring write lock...success
Adapters:
{F4257682-2F79-43EB-B609-1A0B0FA8CD9C}
"*isatap"
"Microsoft ISATAP Adapter #2"
"isatap.tw.trendnet.org":
binding ms_server to Microsoft ISATAP Adapter #2
binding ms_server to Microsoft ISATAP Adapter #2
binding ms_server to Microsoft ISATAP Adapter #2
{EC0511C0-6DFC-4A38-9014-6889A8B4187A}
"*teredo"
"Teredo Tunneling Pseudo-Interface"
"Local Area Connection* 11":
binding ms_server to Teredo Tunneling Pseudo-Interface
binding ms_server to Teredo Tunneling Pseudo-Interface
binding ms_server to Teredo Tunneling Pseudo-Interface
{825DBBB5-C434-40E6-9778-11DCF480D3CF}
"*isatap"
"Microsoft ISATAP Adapter"
"Reusable ISATAP Interface {825DBBB5-C434-40E6-9778-11DCF480D3CF}":
binding ms_server to Microsoft ISATAP Adapter
binding ms_server to Microsoft ISATAP Adapter
binding ms_server to Microsoft ISATAP Adapter
{E0E0FECF-47D1-40CE-AC08-8D1E5AE1D359}
"pciven_8086&dev_100e&subsys_001e8086"
"Intel(R) PRO/1000 MT Desktop Adapter"
"Local Area Connection":
binding ms_server to Intel(R) PRO/1000 MT Desktop Adapter
binding ms_server to Intel(R) PRO/1000 MT Desktop Adapter
binding ms_server to Intel(R) PRO/1000 MT Desktop Adapter
binding ms_server to Intel(R) PRO/1000 MT Desktop Adapter
binding ms_server to Intel(R) PRO/1000 MT Desktop Adapter
binding ms_server to Intel(R) PRO/1000 MT Desktop Adapter
{DCB14C61-690D-46F7-8A89-150432FA5C44}
"ms_agilevpnminiport"
"WAN Miniport (IKEv2)"
"Local Area Connection* 2":
{E2F8A220-AF88-446C-9A55-453E58DD3A33}
"sw{eeab7790-c514-11d1-b42b-00805fc1270e}"
"RAS Async Adapter"
"Local Area Connection* 10":
{7C5653F0-144A-4534-9E34-28AC99CBA85E}
"ms_ndiswanip"
"WAN Miniport (IP)"
"Local Area Connection* 8":
{72DD97A9-E544-4915-88D8-44E829C34F68}
"ms_ndiswanbh"
"WAN Miniport (Network Monitor)"
"Local Area Connection* 7":
{F3229805-869E-479E-BA76-DD643F1D1B80}
"ms_ndiswanipv6"
"WAN Miniport (IPv6)"
"Local Area Connection* 6":
{DB2B4279-B5CF-4626-9DBA-32D0ECE44C87}
"ms_pppoeminiport"
"WAN Miniport (PPPOE)"
"Local Area Connection* 5":
{C0DE3E38-8BA7-479F-8B75-833F294C5AA8}
"ms_pptpminiport"
"WAN Miniport (PPTP)"
"Local Area Connection* 4":
{483C9FF8-503D-414B-B402-E4C1F1F568CB}
"ms_l2tpminiport"
"WAN Miniport (L2TP)"
"Local Area Connection* 3":
{E28D896F-9EA8-433A-9C10-66C97C19A921}
"ms_sstpminiport"
"WAN Miniport (SSTP)"
"Local Area Connection*":
applying changes...
cleaning up...releasing write lock...success
finished (0)

 

執行完後 ,可以確認 File and Printer Sharing 變成啟用了:

Win7 SP1 en

 

nvspbind 算是個蠻方便的工具,有需要的人可以試試看囉~

(雖然我覺得會需要用到的人應該不多啦…)

 

(本頁面已被瀏覽過 1,489 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料