Wednesday, 21 July 2010

APP-V Hide the command DOS box

If you are performing some Prelaunch application configuration within your OSD files you will likely find the DOS command box popping up at application launch which is very annoying and amateur looking and also can lose the focus on the applcation you were working in.

There are 2 ways i like to workaround this.

Option 1.
One is to simply create all AppCompat scripts in VBS
This makes a nice standard and you can store the VBS alongside the OSD and SFT packages.
This does however obviously require some scripting knowledge but once you build a good
set of scripts you should have a template to cover the most common appcompat tasks.

Option 2
If you still love using the simple command line stuff then an Alternative workaround
is to put the required commands into a Batch file and then call the batch file with a
simple VBS that hides the command window.

So create a "RunHidden.VBS" that containing the following line of code

CreateObject("Wscript.Shell").Run WScript.Arguments(0), 0, False

Then use this VBS to call your batch file inside your OSD file

wscript RunHidden.vbs AppCompat.bat


NOTE :
App-V 4.6 onwards does not like native commands in the OSD files anymore, and gives an error
"04-00000020 - A Script element in this OSD file is missing an executable. - 4.6 Client Error"

So calling a batch file or a VBS script is the only way now anyhow.


No comments:

Post a Comment