Created
August 14, 2013 07:45
-
-
Save phx/6228793 to your computer and use it in GitHub Desktop.
popular *nix commands ported to windows cmd.exe environment.
This file contains hidden or 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
| # touch | |
| ## doesn't work on read-only files | |
| type nul >>file & copy file +,, | |
| ## for read-only files, use the following: | |
| :touch | |
| if not exist "%~1" type nul >>"%~1"& goto :eof | |
| set _ATTRIBUTES=%~a1 | |
| if "%~a1"=="%_ATTRIBUTES:r=%" (copy "%~1"+,,) else attrib -r "%~1" & copy "%~1"+,, & attrib +r "%~1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment