将焦点集中到批量应用程序 [英] Set focus to an application with batch

查看:129
本文介绍了将焦点集中到批量应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是WinXP,我有一个批处理脚本,我可以确定Excel表的文件名,然后通过简单地启动Excel表来启动它。

I'm using WinXP and I have a batch script where I determine the filename of an Excel sheet and then launch it by simply launching that Excel sheet.

问题是Excel当时正在运行。所以当批处理文件启动Excel工作表时,Excel会发送到前面,并打开Excel工作表。但是,焦点仍然在批处理文件运行的DOS框中。

The problem is that Excel is running at that time. So when the batch file launches the Excel sheet, Excel is sent to front and the Excel sheet opens. However, the focus still is on the DOS-box where the batch file is running.

在这种情况下,如何将焦点设置为Excel表?

How do I set the focus to the Excel sheet in this situation?

推荐答案

尝试将文件直接传递到Excel:

Try passing the file directly to Excel:

excel.exe "C:\Path\To\file.xlsx"

我们使用开放式办公室时无法测试。

Can't test as we use open office.

编辑:

START /B (excel.exe "C:\Path\To\file.xlsx")

这篇关于将焦点集中到批量应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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