Skip to content

Instantly share code, notes, and snippets.

@cocolacre
Last active December 3, 2017 02:47
Show Gist options
  • Save cocolacre/80781d3a8886f623dbf059050a1cdeab to your computer and use it in GitHub Desktop.
Save cocolacre/80781d3a8886f623dbf059050a1cdeab to your computer and use it in GitHub Desktop.
::hmm.bat
:: v.ht/hmm1
:: #### !!! Must have Notes folder in \Documents\
::create a file
@echo off
set tag=%1
::if "%tag%" == ""
setlocal
set t0=%time%
set t1=%t0:~0,1%
if "%t1%" == "1" goto LONG_TIME
if "%t1%" == "2" goto LONG_TIME
set _T=0%time:~1,8%
goto CREATE_NOTE_FILE
:LONG_TIME
set _T=%time:~0:8%
:CREATE_NOTE_FILE
set _H=%_T:~0,2%
set _M=%_T:~3,2%
set _S=%_T:~6,2%
set _Day=%date:~0,2%
set _Month=%date:~3,2%
set _Year=%date:~6,4%
set _fname=note-%tag%_%_H%%_M%%_S%_%_Day%%_Month%%_Year%.txt
echo %_fname%
echo. >> %cmdlog%
echo %time% %date% >> %cmdlog%
echo NOTE CREATED: %up%\Documents\Notes\%_fname% >> %cmdlog%
echo Created %time:~0,8% %date% >> %up%\Documents\Notes\%_fname%
echo new note at: %up%\Documents\Notes\%_fname%
start notepad.exe %up%\Documents\Notes\%_fname%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment