Windows 10: How to close Batch filecmd command automatically after running

Discus and support How to close Batch filecmd command automatically after running in Windows 10 Network and Sharing to solve the problem; Hi EverybodyOnedrive mklink not syncingupdating files on a Windows 10 Server. So this is what I did. 1. Create a Mklink to sync Pastel Folder -... Discussion in 'Windows 10 Network and Sharing' started by JacquesRossouw-ZA, Jul 2, 2023.

  1. How to close Batch filecmd command automatically after running


    Hi EverybodyOnedrive mklink not syncingupdating files on a Windows 10 Server. So this is what I did. 1. Create a Mklink to sync Pastel Folder - Working2. 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 - Working4. Only problem - Batch file\CMD Window doesnt close automatically after run. - Not WorkingWhat command must I add to Batch file to close CMD window????

    :)
     
    JacquesRossouw-ZA, Jul 2, 2023
    #1
  2. djmcnz Win User

    running DOS as ADMIN

    I assume you don't have 'exit' anywhere in your batch file?

    Rather than playing with 'pause' - if you want to see the output...

    1. Open a command window as admin
    2. Run the batch file manually
    3. Command window will not close unless the 'exit' command is issued
    4. Read output
    That's the first step I'd take to diagnose. Then run every line in your batch file manually, one-by-one, in your admin command window (copy and paste from the actual batch file, don't retype the commands).

    You'll soon find your problem.
     
    djmcnz, Jul 2, 2023
    #2
  3. fatkatie Win User
    Clear command prompt history from within batch.

    I have a batch, running in "Command Prompt", that prompts for a password. For any number of reasons I can't guarantee that the window will close before exposing that data (arrow keys browse history list).

    Is there a way to keep the password out of the list or is there a way to clear the list from within the batch itself?

    Thank you.
     
    fatkatie, Jul 2, 2023
    #3
  4. How to close Batch filecmd command automatically after running

    Windows Apps automatically closes

    hey,

    I suggest you to perform the following steps one by one and check if it helps.

    • Running the App troubleshooter
    Run the App troubleshooter named Windows store Apps from control Panel and check if it helps.

    If not then,

    • Perform System File Check (SFC)
    Follow the steps:

    a. Press “Windows Key + Q” to open search Bar.

    b. Type cmd without quotes in the search box.

    c. On the left pane, right click on the “cmd” option and select “Run as Administrator”.

    d. Type sfc /scannow’ without quotes and hit enter.

    If still not helps then,

    • run the System update readiness command. It detects incorrect manifests, cabinets or registry data, it may replace the incorrect data with corrected version available. Follow the steps.
    • Press Windows key + X.
    • Click command prompt (Run as administrator).
    • In the Administrator: Command Prompt window, type the following commands. Press Enter key after each command:
    DISM.exe /Online /Cleanup-image /Scanhealth

    DISM.exe /Online /Cleanup-image /Restorehealth

    To close the Administrator: Command prompt window, type Exit, and then press Enter.

    Reply back with the results would be happy to help.
     
    Sumit Dhiman2, Jul 2, 2023
    #4
Thema:

How to close Batch filecmd command automatically after running

Loading...
  1. How to close Batch filecmd command automatically after running - Similar Threads - close Batch filecmd

  2. How to close Batch filecmd command automatically after running

    in Windows 10 Gaming
    How to close Batch filecmd command automatically after running: Hi EverybodyOnedrive mklink not syncingupdating files on a Windows 10 Server. So this is what I did. 1. Create a Mklink to sync Pastel Folder - Working2. Create batch file with following commands - working%localappdata%\Microsoft\OneDrive\onedrive.exe /shutdown...
  3. How to close Batch filecmd command automatically after running

    in Windows 10 Software and Apps
    How to close Batch filecmd command automatically after running: Hi EverybodyOnedrive mklink not syncingupdating files on a Windows 10 Server. So this is what I did. 1. Create a Mklink to sync Pastel Folder - Working2. Create batch file with following commands - working%localappdata%\Microsoft\OneDrive\onedrive.exe /shutdown...
  4. 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...
  5. How to run a batch file "ShareX.exe -ImageEditor %1" so that the batch window can close...

    in Windows 10 Network and Sharing
    How to run a batch file "ShareX.exe -ImageEditor %1" so that the batch window can close...: I can't figure out how to run a batch file "ShareX.exe -ImageEditor %1" so that the batch console window can close while the "ShareX.exe -ImageEditor %1" window remains open.Any suggestions about where I could find the answer would be much appreciated.If this is the wrong...
  6. HOW: Robocopy command to a batch-file

    in Windows 10 Network and Sharing
    HOW: Robocopy command to a batch-file: This working fine in a Command Prompt: robocopy "C:\¤Head Folder\Folder 01\Old folder" "C:\¤Head Folder\Folder 01\New folder" /mov /minage:930 How do I make a Batch file .BAT with that RoboCopy command...
  7. run a powershell command like a batch file

    in Windows 10 Installation and Upgrade
    run a powershell command like a batch file: I am working as a temp on a Windows 7 to Windows 10 migration team. We've encountered a problem with some software, and a solution has been found that requires us to execute a a single command with PowerShell. However, the command is extremely long and complex, and very...
  8. Batch commands

    in Windows 10 Network and Sharing
    Batch commands: I know this stuff is kind of old tech, but would anyone know how to make a script that goes through the contents of a folder or file and uses them as command-line arguments say in pseudocode it might look something like: for each item in Desktop, copy %name% to D:\ a USB...
  9. SFTP command for automatic batch job

    in Windows 10 Customization
    SFTP command for automatic batch job: psftp *** Email address is removed for privacy *** -l username -pw password If I am using sftp in windows 10, what is the command to put the password behind like psftp ?...
  10. Automatically Run Batch Script

    in Windows 10 Installation and Upgrade
    Automatically Run Batch Script: Hi everyone When the windows installation is finished, automatically run batch script. How can I do that? Thanks *Wink 122531