Windows 10: cmd closing after opening an batch file

Discus and support cmd closing after opening an batch file in Windows 10 Software and Apps to solve the problem; why does my cmd closes after i open an batch file... Discussion in 'Windows 10 Software and Apps' started by Alex Gabriel2, Dec 24, 2024.

  1. cmd closing after opening an batch file


    why does my cmd closes after i open an batch file

    :)
     
    Alex Gabriel2, Dec 24, 2024
    #1

  2. How to close Batch file(cmd command) automatically after running

    Hi Everybody

    Onedrive mklink not syncing(updating) files on a Windows 10 Server.

    So this is what I did.

    1. Create a Mklink to sync Pastel Folder - Working

    2. Create batch file with following commands - working

    %localappdata%\Microsoft\OneDrive\onedrive.exe /shutdown %userprofile%\AppData\Local\Microsoft\OneDrive\OneDrive.exe /background

    3. Create Task in Windows Task scheduler to run Batch file every hour - Working

    4. Only problem - Batch file\CMD Window doesnt close automatically after run. - Not Working

    What command must I add to Batch file to close CMD window????
     
    JacquesRossouw-ZA, Dec 24, 2024
    #2
  3. PolloVN Win User
    When I add the extension >nul in my batch file, CMD opens and closes instantly.

    So I was gonna do a batch program, I basically needed to add like a little delay so I did

    ping 127.0.0.1>nul

    But when I tried opening the batch program, it instantly closes.

    So I triend running the command in CMD (not in a batch file)

    Then it says this:

    C:\Users\(name)>ping 127.0.0.1>nul

    The system cannot find the file specified.

    The Windows version i have is Windows 8.1 Pro.
     
    PolloVN, Dec 24, 2024
    #3
  4. Lillebror Win User

    cmd closing after opening an batch file

    Batch Files Knowledge Base

    You can't just rename a batch file to .exe *Big Grin cmd closing after opening an batch file :D it wont ever work! =D and that "bench" is built into vista *Smile cmd closing after opening an batch file :) And you cant input text into another cmd window.. But if you want to open calc.exe from a batch file just type calc.exe *Smile cmd closing after opening an batch file :)
     
    Lillebror, Dec 24, 2024
    #4
Thema:

cmd closing after opening an batch file

Loading...
  1. cmd closing after opening an batch file - Similar Threads - cmd closing opening

  2. cmd closing after opening an batch file

    in Windows 10 Gaming
    cmd closing after opening an batch file: why does my cmd closes after i open an batch file https://answers.microsoft.com/en-us/windows/forum/all/cmd-closing-after-opening-an-batch-file/43dda1c4-0099-4d80-948a-a1a669676abf
  3. CMD and Powershell instantly closes after opening it.

    in Windows 10 BSOD Crashes and Debugging
    CMD and Powershell instantly closes after opening it.: For I think a few years now, whenever I open CMD, Powershell or something similar, it is there for a few seconds and I can use it but then it just randomly closes.I have been looking for fixes for so long can someone please help me?...
  4. CMD and Powershell instantly closes after opening it.

    in Windows 10 Gaming
    CMD and Powershell instantly closes after opening it.: For I think a few years now, whenever I open CMD, Powershell or something similar, it is there for a few seconds and I can use it but then it just randomly closes.I have been looking for fixes for so long can someone please help me?...
  5. CMD and Powershell instantly closes after opening it.

    in Windows 10 Software and Apps
    CMD and Powershell instantly closes after opening it.: For I think a few years now, whenever I open CMD, Powershell or something similar, it is there for a few seconds and I can use it but then it just randomly closes.I have been looking for fixes for so long can someone please help me?...
  6. CMD And PowerShell Open And Close

    in Windows 10 Gaming
    CMD And PowerShell Open And Close: I was playing a game and out of nowhere my game tabbed out and cmd flashed open and closed immediately and seconds later PowerShell did the same thing. I thought nothing of it so I kept playing and then it kept happening after every game. I haven't updated anything and i...
  7. CMD And PowerShell Open And Close

    in Windows 10 Software and Apps
    CMD And PowerShell Open And Close: I was playing a game and out of nowhere my game tabbed out and cmd flashed open and closed immediately and seconds later PowerShell did the same thing. I thought nothing of it so I kept playing and then it kept happening after every game. I haven't updated anything and i...
  8. Command Prompt closes immediately after opening batch file

    in Windows 10 News
    Command Prompt closes immediately after opening batch file: [ATTACH]When we execute a batch file, the Command Prompt opens and closes automatically after processing the batch file. Sometimes, the command is executed so quickly that it seems like the Command Prompt closes immediately after opening the batch (BAT) file. This prevents...
  9. CMD Batch file help

    in Windows 10 Support
    CMD Batch file help: Hello, i am running into a issue i am trying to resolve but im getting nowhere and hopefully someone could help me. I'm simply trying to point a copy to parent or "grand"parent directory/folder. I tried ".." but it seems to come back the same message Code: The system cannot...
  10. Cmd closes after open

    in Windows 10 BSOD Crashes and Debugging
    Cmd closes after open: Hello, I installed some program which edited my regedit. As a result there is some cmd starting and closing after every startup and I can't open new cmd because it closes immediately, only powershell works. I found in history that my AutoRun value in...