netsh

Get Network Interface Names and Set All to DHCP Batch Script

ぐ巨炮叔叔 提交于 2019-12-10 11:48:29
问题 I am trying to make a batch that will get all of the Network Interface names (ex. 'Local Area Connection', 'Local Area Connection 2') and set them to DHCP. This is what I have so far : set netsh=wmic nic where "netconnectionid like '%%'" get netconnectionid for %%i in ("%netsh% | FIND /V 'Net'") do (netsh interface ip set address "%%i" dhcp) My output is : The filename, directory name, or volume label syntax is incorrect. Can anyone assist me in fixing this script, or proposing a better way

设置Windows防火墙端口(禁用/开启)

不羁岁月 提交于 2019-12-10 06:48:57
前言:根据防火墙的规则,所以方便管理防火墙的端口,所以写了一个bat批处理脚本方便管理和控制,易于方便其他不懂防火墙规则的运维人员操作。直接上代码如下: @echo off mode con: cols=85 lines=30 rem color脚本颜色 color 0D cls echo.----------------------------防火墙设置----------------------------- echo. echo -----------------------禁用/启用tcp_udp端口-------------------------- echo. echo.(1:启用端口 2:禁用端口) echo. set start= set /p start= 请输入(1或者2)后按回车键: if "%start%"=="1" goto on_WIN2008 if "%start%"=="2" goto off_WIN2008 :on_WIN2008 set port_1= set /p port_1= 输入(1-65535)端口号后按回车键---启用端口: if "%port_1%" == "" goto on_win2008 sc config lanmanserver start= disabled netsh advfirewall set

Got “The system cannot find the file specified” when I run NETSH from CreateProcess but it works ok on Command Prompt?

眉间皱痕 提交于 2019-12-09 00:46:56
问题 I have an NT service that calls a console program written in Delphi 7, let's call it failover.exe that in turn calls NETSH using a procedure I found: procedure ExecConsoleApp(CommandLine: ansistring; Output, Errors: TStringList); Note: ExecConsoleApp uses CreateProcess, see the following link for full code: http://www.delphisources.ru/pages/faq/base/createprocess_console.html I would pass the following to CommandLine before calling ExecConsoleApp : cmd.exe /c "C:\Windows\system32\netsh.exe

Adding SSL Certificate via “netsh.exe” does not last after a machine restart

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 13:59:40
问题 I am currently building an ASP.Net MVC 3 eccomerce app that uses IIS Express for my development server. As we are accepting payments via the app we need to enforce SSL connections for the checkout process. After following Scott Hanselman's well written article on how to set up self signed SSL certificates for use with IIS Express, I can access my site via both: http://localhost https://localhost This is all gravy, until I restart. It seems that each time I restart (for whatever reason) I need

Owin self host SSL connection reset

做~自己de王妃 提交于 2019-12-07 06:05:55
问题 I got an issue when setting up HTTPs for a self host Owin console application. The browser always shows a connection reset error. I've tried creating certificates manually according to this link http://chavli.com/how-to-configure-owin-self-hosted-website-with-ssl/ but I still get the connection reset issue on that port. And I've checked the windows event log and there's no error messages. The application will create X509 certificate by itself and run netsh command automatically. Without Ssl,

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

夙愿已清 提交于 2019-12-06 19:43:27
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\FirewallAllowIncoming] [HKEY_CLASSES_ROOT\exefile\shell\FirewallAllowIncoming\command] @="netsh advfirewall firewall add

querying netsh in c#

久未见 提交于 2019-12-06 12:27:00
问题 I've been trying to come up with an ideal way to query WiFi information using C#. I've tried the netsh method but was unsure how to separate the information. I notice that Vistumbler uses netsh . Is there a way that these developers would have separated the information when querying netsh or have they just performed a lot of string manipulation to cut out the irrelevant stuff. 回答1: That is what I do usually. Call netsh , get the output and parse it. Process p = new Process(); p.StartInfo

Use netsh advfirewall to Add windows 7 firewall exception [closed]

谁说胖子不能爱 提交于 2019-12-06 09:37:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Hi I am adding a firewall exception to Windows 7 using netsh. The simple rule i am adding is: netsh advfirewall firewall add rule name = "The Test App3" dir = in action = allow description = "Smart Cipher inbound messages" program = "C:\temp\a.exe" The problem is that after executing this command a new rule is

windows bat

≯℡__Kan透↙ 提交于 2019-12-06 05:29:47
目录 windows bat netsh2-ipv4 新建文件夹 Windows 10 右下角时间显示时分秒 windows route 系统自动登录cmd命令 删除RunMRU【运行记录】 windows bat netsh2-ipv4 Windows设置IP地址的bat脚本 @echo off title netsh2-ipv4 :nc rem //选择网卡 echo --请根据网卡名选择网卡: echo ex 、退出(exit) echo 01 、以太网(win8\win10) echo 02 、本地连接(win xp\win7) echo 03 、WLAN echo 04 、Enternet echo 05 、Local Area Connection echo. echo --请选择后回车: set /p netname= if %netname%==ex exit if %netname%==01 set NAME="以太网" if %netname%==02 set NAME="本地连接" if %netname%==03 set NAME="WLAN" if %netname%==04 set NAME="Enternet" if %netname%==05 set NAME="Local Area Connection" echo 您选择的网卡是%NAME%

Java create wifi hotspot in Windows 8

蓝咒 提交于 2019-12-05 18:34:56
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(), System.out)).start(); PrintWriter stdin = new PrintWriter(p.getOutputStream()); //now I use the stdin