Script required to automatically connect to specific Wi-Fi network

Page 6 of 8 FirstFirst ... 45678 LastLast

  1. Posts : 7,606
    Windows 10 Home 20H2
       #51

    Never mind. All of you seem to be criticizing my own way of writing codes.
      My Computer


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #52

    Matthew Wai said:
    Never mind. All of you seem to be criticizing my own way of writing codes.

    Excuse me Matthew, we at NO stage mentioned ANYONE. I was initially replying to W10 Tweaker 's statement here . . .

    W10 Tweaker said:
    If the bracket or space are not required, is the purpose only to make the script easier to comprehend?

    I then went on to say . . .

    Paul Black said:
    Different people have their own set ways of writing code that suits them. I personally use spaces and code blocks etc as opposed to a long string of commands in one line because it makes the code easier to read and troubleshoot.

    I hope this clarifies the situation.
      My Computer


  3. Posts : 7,606
    Windows 10 Home 20H2
       #53

    W10 Tweaker said:
    Affirmative, this leaves a cmd window open. Thanks.
    Now, enter the following path with the quotation marks into the "Add arguments (optional)" field. Then, manually run the task and see whether a window will pop up.

    "C:\Scripts\WLAN\Netsh.vbs"

    W10 Tweaker said:
    Reliability Count;
    4 successful connects for the past 6 attempts.
    When it failed, did you check the "Last Run Time" and "Last Run Result" on Task Scheduler? You may add another event ID that may add to the reliability.

    Paul Black said:
    I hope this clarifies the situation.
    There is no need to clarify anything. I already wrote "Never mind" before you wrote the clarification.
    Messy codes are used in "Create_an_elevated_shortcut.bat", which has been downloaded more than a thousand times. So, never mind about messy codes.
    Last edited by Matthew Wai; 10 Mar 2021 at 05:06.
      My Computer


  4. Posts : 56,822
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #54

    Sorry, I'm confused. Are you knocking your own work?

    There is no need to clarify anything. I already wrote "Never mind" before you wrote the clarification.
    Messy codes are used in "Create_an_elevated_shortcut.bat", which has been downloaded for more than a thousand times. So, never mind about messy codes.
    Create Elevated Shortcut without UAC prompt in Windows 10
    Script required to automatically connect to specific Wi-Fi network-2021-03-08_13h11_15.png
      My Computers


  5. Posts : 1,807
    Windows 10 Pro 21H1 19043.1348
    Thread Starter
       #55

    Matthew Wai said:
    Never mind. All of you seem to be criticizing my own way of writing codes.

    I would never criticize your ways and you're very entitled to do what works best for you. And I doubt anyone else here would do such a thing. Sometimes joking statements are tough for anyone in any language and may be misconstrued.

    I've been accused of OCD more than a few times, I just choose to see it as being particular and having an unusual appreciation for symmetry in most things, including columns or lines of text.

    Matthew Wai said:
    Now, enter the following path with the quotation marks into the "Add arguments (optional)" field. Then, manually run the task and see whether a window will pop up.

    "C:\Scripts\WLAN\Netsh.vbs"

    When it failed, did you check the "Last Run Time" and "Last Run Result" on Task Scheduler? You may add another event ID that may add to the reliability.

    FYI, I did create a new file called 0308 Netsh.vbs and placed it in C:\Scripts\WLAN.
    I changed the Argument in my WLAN connect task to "C:\Scripts\WLAN\Netsh.vbs".
    Again, the same cmd window appeared when I manually ran that task

    Script required to automatically connect to specific Wi-Fi network-0308-netsh-cmd-window.jpg


    I'm still analyzing the TS log files.
    Last edited by W10 Tweaker; 08 Mar 2021 at 18:39.
      My Computer


  6. Posts : 7,606
    Windows 10 Home 20H2
       #56

    W10 Tweaker said:
    I changed the Argument in my WLAN connect task to "C:\Scripts\WLAN\Netsh.vbs".
    In "Netsh.vbs", replace the original line with the following line:
    Code:
    CreateObject("WScript.Shell").Run"%WinDir%\System32\netsh.exe wlan connect ""[ssid]"" ""{profile name]"" ""Wi-Fi"""
    You can see that the only difference is the addition of the highlighted part. Manually run the task again. If an error arises, the problem lies in that part. Note that a flashing window is normal.

    W10 Tweaker said:
    I'm still analyzing the TS log files.
    You may run the following command via PowerShell to view the task results:

    Get-ScheduledTaskInfo "Task Name"

    Replace Task Name with the actual name.

    f14tomcat said:
    Sorry, I'm confused. Are you knocking your own work?
    I am praising my own work. The codes work perfectly although they look messy. Don't jude a code by its look.
      My Computer


  7. Posts : 56,822
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #57

    Matthew Wai said:
    In "Netsh.vbs", replace the original line with the following line:
    Code:
    CreateObject("WScript.Shell").Run"%WinDir%\System32\netsh.exe wlan connect ""[ssid]"" ""{profile name]"" ""Wi-Fi"""
    You can see that the only difference is the addition of the highlighted part. Manually run the task again. If an error arises, the problem lies in that part. Note that a flashing window is normal.

    You may run the following command via PowerShell to view the task results:

    Get-ScheduledTaskInfo "Task Name"

    Replace Task Name with the actual name.

    I am praising my own work. The codes work perfectly although they look messy. Don't jude a code by its look.
    Matthew, I did not judge anything. It wasn't even the content I was referring to. It was your post. I know there is a world of room to blame English vs Chinese vs whatever language you choose, but, the wording of your post in no way implied you were praising your own work, in fact just the opposite. Please do not preach to me about English not being your first language. I, and no one else, could see something that is not there.
      My Computers


  8. Posts : 7,606
    Windows 10 Home 20H2
       #58

    Thanks for the kind feedback. My English wording leaves much to be desired.
      My Computer


  9. Posts : 1,807
    Windows 10 Pro 21H1 19043.1348
    Thread Starter
       #59

    Matthew Wai said:
    Thanks for the kind feedback. My English wording leaves much to be desired.


    I'd say you do far better with English than many native English speakers do. Smile and be happy.
      My Computer


  10. Posts : 56,822
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #60

    Matthew Wai said:
    Thanks for the kind feedback. My English wording leaves much to be desired.
    Matthew, you know I did not say anything negative to you or about you. I asked about your post because you seemed to be contradicting yourself. I cannot overcome your sympathy vote here. I won't try. But I wish you would be a bit more open and not hide behind a language issue that may or may not exist.
      My Computers


 

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

Designer Media Ltd
All times are GMT -5. The time now is 19:22.
Find Us




Windows 10 Forums