如何用命令开启ICS服务?
求解答,如何用命令开启ICS服务,共享本地连接,参数,命令。
1)重设winsock --a)去运行框里面的cmd然后输入Netsh winsock reset,然后重启 2)装反间谍软件因为有些间谍软件会不让你使用系统防火墙。 3)去控制面板,双击administrative tools管理工具,找到服务项,勾上Windows Firewall/Internet Connection Sharing (ICS)的服务,把启动值改为自动,应用,重启电脑。
手动设置ics的方法:(附图) 需要提醒的是 开启ics之后内网的 也就是另外一个连接的ip会被改掉 需要手动修改 让后把其他机子的网关和dns都设置到有网络的这台机子的内网网卡上(ip要在同一网段这个你知道吧) 实现共享了。
'↓运行命令↓ 'cscript /nologo ics。vbs "无线网络连接" "本地连接" "off" '将以上代码保存为*。bat文件运行,三个参数分别为,供别人连接的网卡名字、提供共享的网卡名称、开启(on)关闭(off) ' VBScript source code OPTION EXPLICIT DIM ICSSC_DEFAULT, CONNECTION_PUBLIC, CONNECTION_PRIVATE, CONNECTION_ALL DIM NetSharingManager DIM PublicConnection, PrivateConnection DIM EveryConnectionCollection DIM objArgs DIM priv_con, publ_con dim switch ICSSC_DEFAULT = 0 CONNECTION_PUBLIC = 0 CONNECTION_PRIVATE = 1 CONNECTION_ALL = 2 Main() sub Main( ) Set objArgs = WScript。
Arguments if objArgs。Count = 3 then priv_con = objArgs(0)'内网连接名 publ_con = objArgs(1)'外网连接名 switch = objArgs(2)'状态切换开关 on 为 打开ics off 相反 if Initialize() = TRUE then GetConnectionObjects() FirewallTestByName priv_con,publ_con end if else DIM szMsg if Initialize() = TRUE then GetConnectionObjects() FirewallTestByName "list","list" end if szMsg = "To share your internet connection, please provide the name of the private and public connections as the argument。
" & vbCRLF & vbCRLF & _ "Usage:" & vbCRLF & _ " " & WScript。scriptname & " " & chr(34) & "Private Connection Name" & chr(34) & " " & chr(34) & "Public Connection Name" & chr(34) WScript。
Echo( szMsg & vbCRLF & vbCRLF) end if end sub sub FirewallTestByName(con1,con2) on error resume next DIM Item DIM EveryConnection DIM objNCProps DIM szMsg DIM bFound1,bFound2 WScript。
echo(vbCRLF & vbCRLF) bFound1 = false bFound2 = false for each Item in EveryConnectionCollection set EveryConnection = NetSharingManager。
INetSharingConfigurationForINetConnection(Item) set objNCProps = NetSharingManager。NetConnectionProps(Item) szMsg = "Name: " & objNCProps。
Name & vbCRLF & _ "Guid: " & objNCProps。Guid & vbCRLF & _ "DeviceName: " & objNCProps。DeviceName & vbCRLF & _ "Status: " & objNCProps。
Status & vbCRLF & _ "MediaType: " & objNCProps。MediaType if EveryConnection。SharingEnabled then szMsg = szMsg & vbCRLF & _ "SharingEnabled" & vbCRLF & _ "SharingType: " & ConvertConnectionTypeToString(EveryConnection。
SharingConnectionType) end if if objNCProps。Name = con1 then bFound1 = true if EveryConnection。SharingEnabled = False and switch="on" then szMsg = szMsg & vbCRLF & "Not Shared。
。。 Enabling private connection share。。。" WScript。Echo(szMsg) EveryConnection。EnableSharing CONNECTION_PRIVATE szMsg = " Shared!" elseif(switch = "off") then szMsg = szMsg & vbCRLF & "Shared。
。。 DisEnabling private connection share。。。" WScript。Echo(szMsg) EveryConnection。EnableSharing CONNECTION_ALL end 希望能帮助到你,麻烦点击“有用”,谢谢!。
答:开始菜单-所有程序-控制面板-管理工具-服务-Internet Connection Sharing (ICS)右击选属性,常规选项卡-启动类型选自动(使之开机...详情>>
答:的意思是找不到指定的文件,你确定你的文件路径正确吗? 另外,调用的部分你用 n(shcmd)试试详情>>