Alex Rivera | Logout

Open text file and program shortcut in a Windows batch file

Asked 2011-07-11T23:12:32.420
42

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"
Edit
Report

1 Answer

25

This would have worked too. The first quoted pair are interpreted as a window title name in the start command.

start "" "myfile.txt"
start "" "myshortcut.lnk"
answered 2013-05-01T16:14:53.260

Your Answer