Use “touch” to create files in windows

Ritik Chourasiya
2 min readApr 21, 2022

--

Unix commands like touch will not work in windows system so, I created a node based command line tool called “touch” to create files using touch(create) command in the terminal of windows.

Here I created a npm package called @ritikchoure/touch which will allow us to use touch command.

npm i -g @ritikchoure/touch

this command will install the @ritikchoure/touch tool globally so we can use it in any folder.

To check the successful installation, run below command in terminal

touch

and check whether your result is looks like below image -

touch by ritik, touch by ritikchoure, touch cmd tool
successfully installation

If you will get some error, go to below section.

You can check version using below command -

touch -v

or

touch --version

Now we can create file using below command -

touch <filename>.<extension>

Note: if you get below error,

touch : File C:\Users\<username>\AppData\Roaming\npm\touch.ps1 cannot be loaded because running scripts is disabled on this
system.

touch by ritik, touch by ritikchoure, touch cmd tool
error occurs

so just go to -

C:\Users\<username>\AppData\Roaming\npm

And find touch.ps1 file and delete it.

touch by ritik, touch by ritikchoure, touch cmd tool
find and delete this file

Thank you for reading!

If you like this article, Unicorn this one! Heart/Like this one and save it for reading it later.

--

--

Ritik Chourasiya
Ritik Chourasiya

Written by Ritik Chourasiya

I’m a 22 year old, still undergraduate backend developer based in India, with 2 years of experience in the software development industry.

No responses yet