在后台运行任何应用程序 [英] Run any application in background

查看:36
本文介绍了在后台运行任何应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

又是一个 VBScript 问题.

Again a VBScript problem.

这是一个工作代码

Set WshShell = WScript.CreateObject("WScript.Shell") 
WshShell.Run """C:\Program Files\TrueCrypt\TrueCrypt.exe""", 0 , false 

这样就完美地在后台运行了truecrypt,但是代码非常不稳定.如果我将路径替换为 iTunes,wmplayer 就会失败.

This runs the truecrypt on the background perfectly, but the code is highly unstable. If I substitute the path for itunes, wmplayer it fails.

有没有代码,可以完全隐藏所有类型的程序?

Is there a code, which can completely run all types of programm hidden?

推荐答案

.Run 启动一个控制台('DOS Box')来执行其他一些进程/程序.您可以控制该控制台的显示模式(例如,通过将 SW_HIDE == 0 作为参数 2 传递来隐藏它),但是其他程序对您的屏幕所做的操作取决于此过程.旨在静默执行的程序(应该)接受诸如 --headless 或/nogui 之类的参数,或者(应该)提供合适的 IPC(例如 COM)接口.因此,如何在后台"启动其他程序无法以一劳永逸"的方式来回答.AFAIK,播放器提供 COM/OCX 接口,使用这些肯定会击败 Sendkeys 巫术.所以谷歌搜索iTunes.Application vbscript"或Wmplayer.OCX".获取有关如何使用这些 COM 对象的一些提示.

.Run starts a console ('DOS Box') to execute some other process/program. You can control the display mode of that console (e.g. hide it by passing SW_HIDE == 0 as param 2), but what this other program does to your screen is up to this process. Programs meant to be executed silently (should) accept arguments like --headless or /nogui, or (should) provide a suitable IPC (e.g. COM) interface. So how to start other programs 'in the background' can't be answered in a 'one strategy for all' way. AFAIK, the players offer COM/OCX interfaces, and using these certainly beats Sendkeys voodoo. So google for "iTunes.Application vbscript" or "Wmplayer.OCX." to get some hints about how to use these COM objects.

这篇关于在后台运行任何应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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