是否可以制作批处理文件检查其他文件是否打开?
所以我想使用批处理文件打开另一个文件,但如果它已经打开两次(如果该文件已经在用户桌面上打开两次),我不希望它打开。是否可以在批处理文件中执行此操作?就像,如果我要打开记事本,如果记事本已经打开两次,那么它就不会打开记事本,但如果记事本根本没有打开,那么它就会打开记事本两次。
这可能吗?
是否可以禁用批处理文件上的关闭 (X) 按钮?
So I want to use a batch file to open another file, but I don't want it to open if it is already open twice (if the file is already open on the user's desktop twice). Is it possible to do that in a batch file? Like, if I were to open notepad, if notepad was already open twice, then it wouldn't open notepad, but if notepad wasn't open at all, then it would open notepad twice.
Is that possible?
Also is it possible to disable the close (X) button on a batch file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要检查可执行文件是否已在运行,请尝试此
此外,如果您想对其执行某些操作,则可以在 %%B 中获取已运行的可执行文件的 PID。
To check if an executable is already running, try this
Additionally, you get in %%B the PID of the already running executable if you want to do something with it.