Windows 10: Running two sequential commands using a .bat

Discus and support Running two sequential commands using a .bat in Windows 10 Ask Insider to solve the problem; I have a shortcut I use to disable my wifi adapter, then reenable it immediately after. The location looks like this: C:\Windows\System32\cmd.exe /k... Discussion in 'Windows 10 Ask Insider' started by /u/thetasfiasco, Feb 16, 2020.

  1. Running two sequential commands using a .bat


    I have a shortcut I use to disable my wifi adapter, then reenable it immediately after. The location looks like this:

    C:\Windows\System32\cmd.exe /k netsh interface set interface Wi-Fi disable & netsh interface set interface Wi-Fi enable

    I would like to create a .bat file to accomplish the same thing but close itself after. This way I can assign it to a key on my mouse and run it whenever.

    I've been trying for about an hour, but I'm new to batch files. So far the closest I've gotten is this:

    C:\Windows\System32\cmd.exe /k netsh interface set interface Wi-Fi disable C:\Windows\System32\cmd.exe /k netsh interface set interface Wi-Fi enable

    But only the first line runs successfully, leaving me with a disable wifi adapter.

    Tips?

    I'd appreciate it if nobody questioned *why* exactly I want to disable and enable my wifi adapter lmao. Just need help with the coding aspect.

    submitted by /u/thetasfiasco
    [link] [comments]

    :)
     
    /u/thetasfiasco, Feb 16, 2020
    #1
  2. Naki Win User

    GPU-Z what command line parameter ?

    Suggestion: /? (-?) and /help (-help) command-line arguments to show a list of all possible arguments in a small window. *Smile Running two sequential commands using a .bat :)
     
  3. sc00VN Win User
    .bat file

    A batch file (.bat extension) is basically a series of commands to be executed by the command-line interpreter. When you open the file, your system runs every command stored in the file from top to bottom, once the final command has been executed, it closes
    itself indicating it has finished its job. However, everything happens so fast you think it closes immediately and that's completely normal.

    If you want the command-line interpreter window to remains open once the last command has been executed, I suggest you do the following:

    - Right click on the .bat file and click on the 'edit' button.

    - It will open a notepad displaying a series of commands.

    - Create a new line by hitting enter after the final text and type in 'pause' without quotes.

    - Save the file and run it. This time the window will remain open.
     
    sc00VN, Feb 16, 2020
    #3
  4. ryanly Win User

    Running two sequential commands using a .bat

    GPU-Z what command line parameter ?

    Current /? (-?) or / help (-help) parameter is invalid
     
    ryanly, Feb 16, 2020
    #4
Thema:

Running two sequential commands using a .bat

Loading...
  1. Running two sequential commands using a .bat - Similar Threads - Running sequential commands

  2. How to run multiple Windows .bat in one master .bat?

    in Windows 10 Software and Apps
    How to run multiple Windows .bat in one master .bat?: Hello All,I would sure appreciate some assistance with this. I have 20 individual batch files that I run routinely, which spin off sequentially numbered copies of a template into different folders. Rather than running through all 20 .bat files, double clicking each, how can I...
  3. Is it safe to run this bat file?

    in AntiVirus, Firewalls and System Security
    Is it safe to run this bat file?: Spo I was wondering how to get sandbox on windows 10 home and I came across this forum saying that I could run this bat file to try and install it.Enable Windows Sandbox Feature in Windows 10 Home Edition Tutorials tenforums.comThe bat file I downloaded was not blocked by...
  4. Help with run command using the command prompt

    in Windows 10 Customization
    Help with run command using the command prompt: Hello, I have a question regarding running a batch file using a command prompt. My batch file is in my directory. I change directory to where my batch file is located at , and run the batch file as shown in my example. But I got an error saying a run is not recognized...
  5. Run bat on opening?

    in Windows 10 Ask Insider
    Run bat on opening?: Is it possible to tell windows to automatically run a bat file when opening? Ty submitted by /u/Rick_S_meme_Pirate [link] [comments] https://www.reddit.com/r/Windows10/comments/m2a2g5/run_bat_on_opening/
  6. Run command not saving the history of commands used

    in Windows 10 Customization
    Run command not saving the history of commands used: I bought refurbished Dell 5050 and noticed a difference from old Dell - both used Windows 10 Pro. When I use the run command, it does not put in the last used command automatically. My old Dell 7010 running Windows 10 Pro would display last used command but now each time I...
  7. Bat Files Won't Run?

    in Windows 10 Gaming
    Bat Files Won't Run?: Basically I'm installing BattlEye for a Steam game and I click the .bat file in the game's subfolder to download it (when I was prompted to download it I clicked no but now I practically need it for most servers), and I download the .bat from the main website and it also...
  8. Change Display With Bat Command?

    in Windows 10 Support
    Change Display With Bat Command?: So I know pressing window+p brings up a menu that allows you to switch display but I want something like a bat command that when run, would switch the display to "Pc screen Only". How would I do this? 32288
  9. Trouble running .bat files

    in Windows 10 Support
    Trouble running .bat files: Hi, I'm trying to run .bat files on Windows 10, but it tells me that "This app can't run on your PC". It doesn't matter what I use it for, .bat files just won't run anyway. Are .bat files no longer supported? (ran fine on Windows 7) Any workarounds? I'm no expert on...
  10. Can't Run .Bat Files

    in Windows 10 Support
    Can't Run .Bat Files: I try to run .bat files and the just run in note pad. There is no "open with" option. 48199