Run any application in background

21,923

.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.

Share:
21,923
mrN
Author by

mrN

Updated on November 21, 2022

Comments

  • mrN
    mrN over 1 year

    Again a VBScript problem.

    Here is a working code

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

    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?