Linux touch command for Windows

Create touch.cmd with the following content and it to ENV Path.

@echo off
setlocal enableextensions disabledelayedexpansion

(for %%a in (%*) do if exist "%%~a" (
    pushd "%%~dpa" && ( copy /b "%%~nxa"+,, & popd )
) else (
    type nul > "%%~fa"
)) >nul 2>&1

Source: https://stackoverflow.com/a/30019017/2277053

Tags