netsh

Check OS version and variable for Network Label

只愿长相守 提交于 2019-12-25 04:07:46
问题 I've been using this code successfully however, looking to adjust it and use when performing netsh commands to rename NIC's - although whilst writing this i'm not sure it's the best route anymore. SET _OSVer=OTHER FOR /F "Tokens=2 Delims=[]" %%a IN ('VER') DO SET _VerNo=%%a FOR /F "Tokens=2-3 Delims=. " %%b IN ("%_VerNo%") DO ( IF "%%b.%%c" EQU "5.2" SET _OSVer=2003 IF "%%b.%%c" EQU "6.0" SET _OSVer=2008 IF "%%b.%%c" EQU "6.1" SET _OSVer=2008R2 IF "%%b.%%c" EQU "6.2" SET _OSVer=2012 IF "%%b.%

netsh(二)

百般思念 提交于 2019-12-23 21:32:12
netsh 来自微软的网络管理看家法宝 很多时候,我们可能需要在不同的网络中工作,一遍又一遍地重复修改IP地址是一件比较麻烦的事。另外,系统崩溃了,重新配置网卡等相关参数也比较烦人(尤其是无线网卡)。事实上,巧妙地利用Windows 2000/XP/2003系统内置的netsh命令,不但可以快速切换IP地址,还可以在静态和动态IP地址设置中随时切换,也可实现随时备份和恢复网络设置等等功能。 n&R2x8`:n!y+e 什么是netsh? netsh是Windows 2000/XP/2003操作系统自身提供的命令行脚本实用工具,它允许用户在本地或远程显示或修改当前正在运行的计算机的网络配置。 实例一:随时随地切换IP地址 TechWeb-技术社区4G9l+W&V#E1w1d2M1c 程序开发,操作系统,服务器,源码下载,Linux,Unix,BSD,PHP,Apach,asp,下载,源码,黑客,安全,技术社区,技术论坛3`,J,e0c1P0R&F9i%a5W   打开“记事本”,新建一个文件,然后在其中输入如下代码:netsh interface ip set address "本地连接" static 192.168.0.10 255.255.255.0 192.168.0.1 1 0e3w3_(@6\"R6z#g tech.techweb.com.cn-A&E Q!L%R+F.g

Can't register a C# generated selfsigned SSL certificate with netsh (error 1312)

北城余情 提交于 2019-12-23 16:38:36
问题 I have created a self-signed SSL certificate via C# (bouncycastle). It shows up in the local computer / personal store and looks exactly like the already existing localhost certificate from Microsoft. If I show the properties, it says: SSL Certificate add failed, Error: 1312 A specified logon session does not exist. It may already have been terminated. However, if I want to register this certificate via netsh, I get an error: netsh.exe http add sslcert ipport=0.0.0.0:{0} certhash={1} appid={2

Windows 10 | regedit | exefile shell command (firewall add rule) - not running

浪尽此生 提交于 2019-12-23 03:12:13
问题 Definitions: using windows 10/64bit firewall is blocking all in/out traffic - except added rules (allow in/out) actual user-account is administrator tested with all user-account-control (uac) settings: from always to never Problem: I have a script that worked fine with windows 7/64 bit, it adds right-click context menu items to .exe files, to add a firewall rule for them: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\exefile\shell] [HKEY_CLASSES_ROOT\exefile\shell

Windows防火墙Netsh十大命令

一曲冷凌霜 提交于 2019-12-23 00:21:44
10. 查询防火墙规则: 使用 netsh 可能需要做的第一件事是发现 Windows 防火墙的当前配置属性。您可以使用以下 netsh 命令查询 Windows 防火墙设置: netsh advfirewall firewall show rule name=all 9. 启用和禁用 Windows 防火墙: 通常最好的做法是保持 Windows 防火墙启用,但是有时在执行测试或设置新应用程序时,需要关闭 Windows 防火墙一段时间。以下命令说明了如何关闭然后重新打开 Windows 防火墙: netsh advfirewall set allprofiles state on netsh advfirewall set allprofiles state off 8. 重置 Windows 防火墙: 如果在配置 Windows 防火墙时出错,则可能需要使用以下 netsh 命令将其重置为默认设置: netsh advfirewall reset 7. 设置日志记录: Windows 防火墙日志文件的默认路径为 \ Windows \ system32 \ LogFiles \ Firewall \ pfirewall.log 。下面的 netsh 命令将日志文件的位置更改为 C : \ temp 目录: netsh advfirewall set

Java create wifi hotspot in Windows 8

旧时模样 提交于 2019-12-22 10:40:15
问题 I need to create a wifi hotspot and a DHCP server in Windows 7-8 with Java. I'm developing a software that could be for the user less intrusive and simple that i could. For the first part of my work, I thought to use netsh to create the hosted network and to set static the ip. my current code is this: String[] command = { "cmd", }; Process p = Runtime.getRuntime().exec(command); new Thread(new SyncPipe(p.getErrorStream(), System.err)).start(); new Thread(new SyncPipe(p.getInputStream(),

Using netsh on PowerShell fails with error: The parameter is incorrect

陌路散爱 提交于 2019-12-19 20:03:40
问题 I've been trying to run the following command on PowerShell: netsh http add sslcert ipport=0.0.0.0:443 certhash=<some certhash> appid={<random guid>} The problem is, it returns "The parameter is incorrect" every time. I've check the cert hash number, and the generated guid and they all alright. In fact, I ran the same command in cmd.exe and it worked perfectly, which adds to the frustration. I want to pass variables as the certhash and appid , which is why I'm using PowerShell. If anyone can

Using netsh on PowerShell fails with error: The parameter is incorrect

南笙酒味 提交于 2019-12-19 20:00:12
问题 I've been trying to run the following command on PowerShell: netsh http add sslcert ipport=0.0.0.0:443 certhash=<some certhash> appid={<random guid>} The problem is, it returns "The parameter is incorrect" every time. I've check the cert hash number, and the generated guid and they all alright. In fact, I ran the same command in cmd.exe and it worked perfectly, which adds to the frustration. I want to pass variables as the certhash and appid , which is why I'm using PowerShell. If anyone can

“The parameter is incorrect.” error using netsh http add sslcert

雨燕双飞 提交于 2019-12-18 03:01:11
问题 Following the instructions on "How to: Configure a Port with an SSL Certificate" in this link: http://msdn.microsoft.com/en-us/library/ms733791.aspx, I entered this command on the commandline (duh): > netsh http add sslcert ipport:10.141.146.227:7001 certhash=5d48e604007b867ae8a69260a4ad318d2c05d8ff appid={EDE3C891-306C-40fe-BAD4-895B236A1CC8} The parameter is incorrect. My certhash thumbprint was taken from the certificate in Certificates(Local Computer)>Personal>Certificates folder. The

What appid should I use with netsh.exe?

…衆ロ難τιáo~ 提交于 2019-12-17 16:25:11
问题 The netsh command wants an appid (see here) : netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF} I've not been able so far to understand how I'm supposed to know the GUID netsh wants me to provide. Any hints? 回答1: You can use any valid GUID. It is only used to allow you to identify the binding later. 回答2: I used the Application GUID for my WCF service that is located within the AsseblyInfo.vb (VB.NET) or