Windows 10: Batch file Script to reboot when no Internet Connection detected?

Discus and support Batch file Script to reboot when no Internet Connection detected? in Windows 10 Support to solve the problem; from time to time my Windows 10 Laptop is unable to connect to the wireless network. Tried literally every other "fix"! The only solution is to reboot... Discussion in 'Windows 10 Support' started by ReallyFrustratd, Apr 20, 2019.

  1. Batch file Script to reboot when no Internet Connection detected?


    from time to time my Windows 10 Laptop is unable to connect to the wireless network.

    Tried literally every other "fix"! The only solution is to reboot the LapTop when this happens...

    The best idea I've come up with is to schedule a task to run a script when the computer starts to check if there is a connection to the internet, (maybe pinging my ISP or Google.com) and if that fails then to reboot the computer.

    I've done all kinds of google searches, and searched this forum, but I can't find any example script of this... any detailed help would be appreciated.

    Thanks

    :)
     
    ReallyFrustratd, Apr 20, 2019
    #1

  2. Running PowerShell script as a batch file

    Hello Baldo,



    Thank you for writing to Microsoft Community Forums.



    I understand that you want to execute the PowerShell commands as a batch file.



    I tried executing the batch file on my machine but I was unable to execute it as the command was incomplete. However, after making some changes in the command I was able to execute the batch file.



    You can try the following command by saving it in a batch file and check if that helps.



    powershell –Command Get-AppxPackage Microsoft.3dBuilder | Remove-AppxPackage



    Also, as the query is related to running a PowerShell script using a batch file, I suggest you to post the issue on

    TechNet
    forums where we have professionals who have more knowledge about the issue.



    Hope it helps.



    Regards,

    Prakhar Khare

    Microsoft Community – Moderator
     
    Prakhar_Khare, Apr 20, 2019
    #2
  3. HAT
    hat Win User
    Batch file needs tweaking

    I've been using AviSynth for deinterlacing and tetelecining TV series lately, and in the process I have to write many scripts for each episode. I've found a batch file that pretty much automates this, but there is one issue. For example, if my source file is "Monk s01e01.mkv", the script the batch file gives me is named "Monk s01e01.mkv.avs". As the files AviSynth produces go by the name of the AVS script, if I processed the script with that name, the resulting file would be "Monk s01e01.mkv.avi". I need to get the .mkv part out of the .avs script the batch file produces. This is the batch file:

    Code: for %%n in (*.mkv*) do ( echo setmtmode(5,4^) > "%%n.avs" echo ffmpegsource2("%%n"^) >> "%%n.avs" echo setmtmode(2^) >> "%%n.avs" echo qtgmc(edithreads=2^) >> "%%n.avs" echo selecteven(^) >> "%%n.avs" )[/quote] So, any way to get the .mkv out of the files produced by this batch file? It really beats having to write a script for each episode individually.
     
  4. Lagcrab Win User

    Batch file Script to reboot when no Internet Connection detected?

    Ethernet/batch scripts & automation

    TL;DR version:"how to force a batch script to run when your computer recognizes that your network is not receiving or sending data"

    For context I created a batch script that will disable and re-enable my Ethernet connection(which for some reason fixes the issue instantly), when I noticed that it would be an infinite amount of times more useful if it ran by
    itself when said issue occurs. (forcing my computer to run it at start up and regularly check for this issue is not an option.) Also, is there a file that I could simply place my batch script into that my ethernet would see and check by itself, and if so
    what would I need to do to make sure that it only runs when the issue occurs? (for example: an already made file in my pc that runs and checks my internet connections for issues)

    EDIT: Just for those of you who are wondering about my computers ethernet specs.

    Network Card(s): 2 NIC(s) Installed.

    [01]: Realtek PCIe GBE Family Controller

    Connection Name: Ethernet

    DHCP Enabled: Yes

    DHCP Server: *** *** ***

    IP address(es)

    [01]: *** *** ***

    [02]: *** *** ***
     
    Lagcrab, Apr 20, 2019
    #4
Thema:

Batch file Script to reboot when no Internet Connection detected?

Loading...
  1. Batch file Script to reboot when no Internet Connection detected? - Similar Threads - Batch file Script

  2. Batch scripting

    in Windows 10 Software and Apps
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  3. Batch scripting

    in Windows 10 Gaming
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  4. Batch scripting

    in Windows 10 Network and Sharing
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press any key. echo Before...
  5. PageFile.sys batch script

    in Windows 10 Virtualization
    PageFile.sys batch script: Hello, I need help writing a batch script that would configure Windows Virtual Memory based on the amount of RAM installed If you have 4 GB of RAM, set virtual memory to 8 GB (Custom size: set both initial and maximum size to 8192) If you have 8 GB of RAM, set virtual memory...
  6. Batch Scripts / Programs.

    in Windows 10 Performance & Maintenance
    Batch Scripts / Programs.: The members and quests who use this forum know how professional, informative and helpful it is! In order to help members solve their problems/issues we often ask them to run certain programs and perform certain tasks and then upload [ post ] the results to the forum for us...
  7. Batch scripting problems

    in Windows 10 Ask Insider
    Batch scripting problems: So i found a bug. In batch scripting, I can only store 3 variables. I don't know the cause for this. Here's the code, if you need it. @ echo off title Elevator OS by Lackmey on YouTube and Reddit set gdata=No data found (this one works) set 1data=No data found (this one...
  8. Netfix Batch Script- Fix internet connection

    in Windows 10 Network and Sharing
    Netfix Batch Script- Fix internet connection: Somebody please try my batch script Netfix and leave feedback so I can improve it. thank you! My goal is to make a troubleshooter to help the built in "Windows Network Diagnostics" fix internet connection problems. How can you help? 1. Download/copy the code on notepad...
  9. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  10. Batch script question

    in Windows 10 Support
    Batch script question: Hello, I want make a batch script to delete a spefic folder on the C disk, but how can I get only that spefic folder? I got this: Code: FOR /D %%p IN ("C:\USERS\%USERNAME%\Downloads\*.*") DO rmdir "%%p" /s /q cd C:\USERS\%USERNAME%\Downloads\ del *.* /q /s timeout /t 5...