10-02-2017 09:50 AM
Hello,
i got an issue, in my script im executing running of new instance with following code
Set oShell = CreateObject("WScript.Shell") oShell.Run """"& cDiademExePath &""" /CScriptStart('" & sScriptToRunPath & "')", 7
Second Diadems opens, but its active and i would like it to be minimized and that the main instance remains active.
By this documentation ( Run Method (Windows Script Host) ), the second parameter controls the behaviour, but it has note "Note that not all programs make use of this information." - Is it this the case?
Is the re some other way to have the new instance minimized, or is there a way to have it not displayed, set visible of the instance to false?
Thanks for info
Solved! Go to Solution.
10-03-2017 09:43 AM
Hi Lukas,
There may be a way to include a DOS extension specific to DIAdem to launch invisibly, but that may not be the best solution for what you want to do. What do you want to do? Are you launching a new DIAdem instance from an existing instance? In that case you might want to explore the option of invoking "worker" DIAdem instances that are by nature invisible (and lower memory footprint) and which can be controlled by the calling parent DIAdem instance. Or are you launching a new DIAdem instance from another program? In that case you might want to consider using the DIAdem ActiveX interface, which has a native flag to run invisibly, and again the calling program can exert control over the executing DIAdem instance.
If you launch DIAdem with a DOS shell command, as you've set out in your post, you will be launching a separate thread, such that if the calling program ends, the DIAdem instance will remain. This may be exactly what you want, but it comes at the cost that the calling program can no longer control the independently launched DIAdem instance. You can tell the DIAdem instance you're launching this way to run a particular VBScript as soon as it launches, and that VBScript can of course minimize the DIAdem application or perform any other tasks you want the independent DIAdem instance to do. But the communication between the calling program and the new DIAdem instance ends at launch time.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-04-2017 05:30 AM
I am calling the run command from script which is running from Diadem.
I want to do exactly this:
- run a script which collect data from user
- after having data, i want to run a new instance of diadem which will do some operations, but the main script should continue doing other operations. the point is when i run a new instance, its active and i cant see the main script running, so i want to do that the new instance should be visible, but minimized and the main script should stay active.
now the main script opens new diadem and i see loading screen and after the new instance, i would like it to be minimized from its launch.
10-05-2017 01:47 PM
Hi Lukas,
It sounds like you should be using one or more DIAdem "workers". What version of DIAdem are you running again?
Brad Turpin
DIAdem Product support Engineer
National Instruments
10-05-2017 01:58 PM
Hi Lukas,
If you're using DIAdem 2014 or later, check out the following 2 objects to see how to use DIAdem "workers"
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-11-2017 02:44 AM - edited 10-11-2017 02:44 AM
im using Diadem 2017 64bit and i solved it by putting
Call WndShow("SHELL","MINIMIZE")
on the beginning of "slave" script runned in second diadem, but running diadem with some parameter which will make it minimalized directly before the loading screen of Diadem would be more elegant, because now i see the loading screen and after its loaded, it gets minimalized.