Last active
February 24, 2021 14:26
-
-
Save davutg/71de5ac29107f228d00d783694e15e1e to your computer and use it in GitHub Desktop.
Batch Scripsts
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
:: BATCH SCRIPT START | |
@ECHO OFF | |
:: Set following variable for file size in Bytes (1024 Bytes=1KB, 1024KB=1MB, 1024MB=1GB) | |
SET /A FileSize=10485760 | |
:: Set following variable for file extensions to check (*.* = all files) | |
SET Filter=*.* | |
:: Set following variable with path to check insided for files | |
SET Folder=C:\destination\log | |
FOR /R "%Folder%" %%F IN (%Filter%) DO ( | |
IF %%~zF GTR %FileSize% ( | |
ECHO Deleting "%%F" | |
DEL /F "%%F")) | |
EXIT /B /0 | |
:: BATCH SCRIPT END |
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 ON | |
FOR /F "tokens=5" %%T IN ('netstat -a -n -o ^| findstr ":8081" ') DO ( | |
SET /A ProcessId=%%T) | |
If not defined ProcessId (call 8081.bat) else (echo %date% %time% AlreadyRunning PID %ProcessId%) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment