A Program By Which User Can Change Wifi Password.

 

change-wifi-password
change wifi password

Here's a batch program that allows the user to change the Wi-Fi password:

    

@echo off

REM Prompt the user for the current Wi-Fi SSID name
set /p currentSSID=Enter current Wi-Fi SSID: 

REM Prompt the user for the new Wi-Fi password
set /p newPassword=Enter new Wi-Fi password: 

REM Change the Wi-Fi password
netsh wlan set profileparameter name="%currentSSID%" keyMaterial=%newPassword%

echo Wi-Fi password updated successfully.
pause


    

  

This batch program prompts the user to enter the current Wi-Fi SSID name and the new Wi-Fi password.

After the user provides the input, the program uses the netsh wlan set profileparameter command to change the Wi-Fi password. It replaces %currentSSID% with the actual SSID name entered by the user, and %newPassword% with the new Wi-Fi password entered by the user.

The program displays a success message and pauses, allowing the user to view the message before the window closes.

Remember to run the batch file as an administrator to ensure successful execution, as changing network settings requires administrative privileges.

Save as:

Past this Lines of codes in a notepad and Save as "CPass-wifi.bat"

Exicution Process of codes:

Let's break down the batch program step by step:

  • 1. `@echo off`: This command turns off the echoing the commands to the command prompt. By using this command, the program's commands and output won't be displayed on the screen.
  • 2. `REM`: This command is used for comments in batch files. It is followed by a comment describing what the subsequent lines of code do.
  • 3. `set /p currentSSID=Enter current Wi-Fi SSID:`: This line prompts the user to enter the current Wi-Fi SSID (network name). The `set /p` command is used to assign the user's input to the `currentSSID` variable.
  • 4. `set /p newPassword=Enter new Wi-Fi password:`: This line prompts the user to enter the new Wi-Fi password. The `set /p` command is used to assign the user's input to the `newPassword` variable.
  • 5. `netsh wlan set profileparameter name="%currentSSID%" keyMaterial=%newPassword%`: This line uses the `netsh wlan set profileparameter` command to change the Wi-Fi password. It specifies the SSID name with the `%currentSSID%` variable and sets the password with the `%newPassword%` variable.
  • 6. `echo Wi-Fi password updated successfully.`: This line displays a success message indicating that the Wi-Fi password has been updated.
  • 7. `pause`: This command pauses the execution of the batch file, allowing the user to view the success message before the window closes. The user can press any key to continue and close the window.


Overall, this batch program prompts the user to enter the current Wi-Fi SSID and the new Wi-Fi password, and then it uses the `netsh wlan set profileparameter` command to update the Wi-Fi password. Finally, it displays a success message and pauses for user confirmation. If You have any Question Contact here:

contact-form

Post a Comment

Previous Post Next Post