0

How to create a .vm (velocity template file) from command line in Windows

Tayyab Bashir
  • 111
  • 13
  • Same as any other file type http://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line-in-windows – Dmitry Dec 30 '15 at 09:32
  • It doesnt work that way, it makes a file named "file.vm" but the file type is "notepad++" – Tayyab Bashir Dec 30 '15 at 10:22

1 Answers1

1

Based on you comment I assume what you really mean is how to made file which by default opens with some specific program you have. Here is several thing to be taken into account:

  1. To create .vm file from command line you can use this question
  2. By default windows doesn't show file extensions in explorer - so you won't actually see that it is .vm file in explorer. Reffer this guide to show file extensions.
  3. There is such thing as file associations - e.g. default program to be use when you open file (for example double click). Also this affect icon shown for the file in explorer.

So to summarize - file created from command line(using method from referred question) have .vm extension. You don't see this cause your windows settings doesn't show extensions. You assume it is text file cause notepad++ icon shown for it as well as it opens with notepad++. That's a wrong assumption - simple you have notepad++ associated to open .vm files. If you want to use different program - you need either:

  1. Change file associations (see link above).
  2. Use open with option to open file with another program (right click menu option)
  3. Use Open function from inside your program.
Community
  • 1
  • 1
Dmitry
  • 1,233
  • 11
  • 14