Adding user interface in batch programme

swapnil007

New member
Local time
5:44 PM
Messages
6
I have this code.

@ECHO OFF
:Values
SET strSSID=
SET strPWD=
ECHO Please enter the ssid:
SET /p strSSID=SSID:
ECHO.
ECHO Please enter the password:
SET /p strPWD=Password:

IF ".%strSSID%"=="." GOTO :TryAgain
IF ".%strPWD%"=="." GOTO :TryAgain

CALL :HostedNW "%strSSID%" "%strPWD%"
pause
GOTO :EOF
:HostedNW
ECHO
C:\Windows\System32\netsh.exe wlan set hostednetwor mode=allow ssid="%~1" key="%~2" keyUsage=persistent
SET strSSID=
SET strPWD=
GOTO :EOF
:TryAgain
CLS
ECHO.
ECHO One or more inputs weren't correct.
ECHO Please try again.
ECHO.
GOTO :Values

In which I have taken the proper inputs from user as SSID and PASSWORD, Now I have second code as:

C:\Windows\System32\netsh.exe wlan start hostednetwork

This code will turn ON the WiFi, and another code which is :

C:\Windows\System32\netsh.exe wlan stop hostednetwork

This code will turn OFF the WiFi.
Now I want all these codes in one codding format and wanted to display a proper user interface in which:
first clickable button will show "Configure WiFi"
second clickable button will show "Turn ON"
third clickable button will show "Turn Off"
fourth clickable button will exit the user interface.

and the respective buttons will run the respective code designed for it in same manner as mentioned above.
If possible suggest me how to improve the user interface of this file.
Please Help Me With This Problem . . .
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo
OS
Windows 8 ultimate 32 bit
Memory
4 GB
Graphics Card(s)
1 GB
Hard Drives
500 GB
Antivirus
windows defender
Browser
chrome & firfox
The Choice command is what you want (minus the clickable buttons part). Feel free to ask for further guidance or for an example of how you may set this up in you script.
 

My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top