Skip to content

Instantly share code, notes, and snippets.

@chrisengelsma
Created March 2, 2017 19:32
Show Gist options
  • Save chrisengelsma/1ecbf96b19c87184da89c6f6760c60a2 to your computer and use it in GitHub Desktop.
Save chrisengelsma/1ecbf96b19c87184da89c6f6760c60a2 to your computer and use it in GitHub Desktop.
"touch" script for Windows Command Prompt
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment