Created
May 10, 2022 04:30
-
-
Save bhaireshm/1b26bdd6b63d1c4c5615bcc0d592d780 to your computer and use it in GitHub Desktop.
Batch script to stop all running node servers in windows.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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