I have two files in the same folder that I\'d like to run. One is a .txt
file, and the other is the program shortcut to an .exe
. I\'d like to make
The command start [filename]
opened the file in my default text editor.
This command also worked for opening a non-.txt file.
Don't put quotes around the name of the file that you are trying to open; start "myfile.txt"
opens a new command prompt with the title myfile.txt
, while start myfile.txt
opens myfile.txt
in Notepad. There's no easy solution in the case where you want to start a console application with a space in its file name, but for other applications, start "" "my file.txt"
works.
I use
@echo off
Start notepad "filename.txt"
exit
to open the file.
Another example is
@echo off
start chrome "filename.html"
pause
If you are trying to open an application such as Chrome or Microsoft Word use this:
@echo off
start "__App_Name__" "__App_Path__.exe"
And repeat this for all of the applications you want to open.
P.S.: This will open the applications you select at once so don't insert too many.
You can also do:
start notepad "C:\Users\kemp\INSTALL\Text1.txt"
The C:\Users\kemp\Install\
is your PATH. The Text1.txt is the FILE.
Its very simple, 1)Just go on directory where the file us stored 2)then enter command i.e. type filename.file_extention e.g type MyFile.tx