打开文本文件和程序的快捷方式在Windows批处理文件 [英] Open text file and program shortcut in Windows batch file

查看:161
本文介绍了打开文本文件和程序的快捷方式在Windows批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在,我想运行同一文件夹中的两个文件。一个是 .TXT 文件,另一种是程序的快捷方式到 .exe文件。我想编写一个批处理文件,在同一个位置打开文本文件和快捷方式,然后关闭该批处理文件(但文本文件和程序保持打开状态)。

我想这没有运气:

 打开myfile.txt的
打开myshortcut.lnk

也没有工作:

 启动myfile.txt的
启动myshortcut.lnk


解决方案

我能够找出解决方案:

 启动记事本myfile.txt的
myshortcut.lnk
出口

I have two files in the same folder that I'd like to run. One is a .txt file, 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"

解决方案

I was able to figure out the solution:

start notepad "myfile.txt"
"myshortcut.lnk"
exit

这篇关于打开文本文件和程序的快捷方式在Windows批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆