Skip to content

Instantly share code, notes, and snippets.

@bhaireshm
Created May 10, 2022 04:30
Show Gist options
  • Save bhaireshm/1b26bdd6b63d1c4c5615bcc0d592d780 to your computer and use it in GitHub Desktop.
Save bhaireshm/1b26bdd6b63d1c4c5615bcc0d592d780 to your computer and use it in GitHub Desktop.
Batch script to stop all running node servers in windows.
@Echo Off
TASKLIST /FI "IMAGENAME eq node.exe"
Echo ================================================================================
Echo:
Echo This will stop all running node servers.
Echo:
Set "#="
Set /P "=Press Y to continue (press any other key to stop) :"<Nul
For /F Skip^=1^ Delims^=^ EOL^= %%$ In ('Replace ? . /U /W') Do If Not Defined # Set "#=%%$"
Echo(
If /I Not "%#%"=="Y" Exit /B
TASKKILL /F /IM node.exe
TASKLIST /FI "IMAGENAME eq node.exe"
TIMEOUT 5
Exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment