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 a batch file in the same location to open the text file and the shortcut then close the batch file (but the text file and program remain open).
I tried this with no luck:
open "myfile.txt"
open "myshortcut.lnk"
Also didn't work:
start "myfile.txt"
start "myshortcut.lnk"
Try using:
"location of notepad file" > notepad Filename
C:\Users\Desktop\Anaconda> notepad myfile
works for me! :)
The command
start [filename]
opened the file in my default text editor.This command also worked for opening a non-.txt file.
You can also do:
The
C:\Users\kemp\Install\
is your PATH. The Text1.txt is the FILE.In some cases, when opening a LNK file it is expecting the end of the application run.
In such cases it is better to use the following syntax (so you do not have to wait the end of the application):
To open a TXT file can be in the way already indicated (because notepad.exxe not interrupt the execution of the start command)
This would have worked too. The first quoted pair are interpreted as a window title name in the start command.