是否可以使用CMD / BAT / VBS更改WiFi托管的网络设置? [英] Is it possible to change the WiFi hosted network settings using CMD/BAT/VBS?

查看:261
本文介绍了是否可以使用CMD / BAT / VBS更改WiFi托管的网络设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用CMD / BAT / VBS更改我的 WiFi热点的两个托管网络设置,但我无法这样做。

I was trying to change two hosted network settings of my WiFi hotspot using CMD/BAT/VBS, but I was unable to do it.

我要更改的设置


  1. 验证WPA,WPA2PSK)

  2. 密码(例如:CCMP / AES)

以下代码显示了托管网络设置的相关信息:

netsh wlan show hostednetwork

以下代码设置了配置文件参数:

netsh wlan set profileparameter

是运行WiFi热点的配置文件名称。
profileparameter 要求提供配置文件名称,我不知道。
我已经尝试导出配置文件,但它不包含配置文件名称。
导出的配置文件数据位于 windows / system32 目录中。

The problem is: what is the profile name which runs the WiFi Hotspot. The profileparameter asks for the profile name, and I dont know it. I have tried exporting the profile but it does not contain the profile name. Exported profile data is located in windows/system32 directory.

有办法解决这个问题吗? / strong>

Is there a way to solve this issue?

资源:
WLAN的Netsh命令

推荐答案

尝试此代码以获取具有管理员权限的配置文件名称及其密码:

Try this code to get the profil name and its password with admin rights :

@echo off
Title Get the Wifi Profile Name with its password by Hackoo tested on french machine
cls & color 0A & echo.
Mode con cols=80 lines=5
:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
Set TmpLogFile=TmpLogkey.txt
Set LogFile=Wifikey_Log.txt
If Exist %TmpLogFile% Del %TmpLogFile%
If Exist %LogFile% Del %LogFile%
REM  --> Check for permissions
Reg query "HKU\S-1-5-19\Environment" >%TmpLogFile% 2>&1
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
Echo.
ECHO                 **************************************
ECHO                  Running Admin shell... Please wait...
ECHO                 **************************************

    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:gotAdmin

::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
setlocal enabledelayedexpansion
for /f "tokens=2 delims=:" %%a in ('netsh wlan show int ^|find /i "profil"') do ( set ProfilName=%%a
    Call:Trim "!ProfilName!"
    echo The profile name is : "!ProfilName!"
    echo The profile name is : "!ProfilName!" > %LogFile%
)
pause
Cls 
echo(
echo The password of your Wifi Network is :
Netsh wlan show profiles name="!ProfilName!" key=clear |Find /i "Conten"
(
    echo The password of your Wifi Network is :
    Netsh wlan show profiles name="!ProfilName!" key=clear |Find /i "Conten"
)>>%LogFile%
pause
Start "" %LogFile%
 ::*************************************************************************************
:Trim <String>
(
    echo Wscript.echo Trim("%~1"^)
)>"%~n0.vbs"
for /f "delims=" %%a in ('Cscript /nologo "%~n0.vbs"') do ( set "Profilname=%%a" )
exit /b
::*************************************************************************************

这篇关于是否可以使用CMD / BAT / VBS更改WiFi托管的网络设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆