Adding user interface in batch programme


  1. Posts : 6
    Windows 8 ultimate 32 bit
       #1

    Adding user interface in batch programme


    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


  2. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #2

    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


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:57.
Find Us