Open text file and program shortcut in a Windows batch file

后端 未结 12 1355
暗喜
暗喜 2020-12-13 17:59

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

12条回答
  •  情深已故
    2020-12-13 18:47

    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):

    START /B /I "MyTitleApp" "myshortcut.lnk"
    

    To open a TXT file can be in the way already indicated (because notepad.exxe not interrupt the execution of the start command)

    START notepad "myfile.txt"
    

提交回复
热议问题