DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to close diadem after script execution

Solved!
Go to solution
Highlighted

Hello,

 

I am starting diadem from batch file with the startscript command line option to execute a VBS doing some stuff. Now the diadem comes up nicely and executes the VBS all fine. HOWEVER the diadem is started in fork/daemon mode meaning the batch is not waiting for it to finish the VBS script and doesnt CLOSE after the script automatically. Can I somehow do this in the VBS at the end automatically? Or can I do this via the batch file?

0 Kudos
Message 1 of 5
(4,214 Views)
Solution
Accepted by topic author ThomasEitzenberger
08-27-2015 04:09 PM

Hello,

 

try Call ProgramExit() or Call ApplicationExit() at the end of the script.

 

gemu


 

Message 2 of 5
(4,186 Views)

Thanx for the hint

 

PLUS if you modified the data (most likely) be sure to set FileModification to "ignore"  to avoid dialog asking whether to save data..

 

br

Thomas

0 Kudos
Message 3 of 5
(4,147 Views)

Hello,

 

i´m doing a similar thing as Thomas. The proposed solution works fine in my script if i open the script with Diadem itself and run it, but not when the Batch-File starts Diadem via scriptstart command. When i use my Batchfile the script does what it is supposed to do but apparently commands like

Call ProgramExit()

and

Call ApplicationExit()

seem to be neglected. Diadem doesn´t close after finishing the script. Does it have to do with how the Batch-File opens Diadem?

 

This is how the Batchfile looks like:

@echo off
set program="C:\Program Files (x86)\National Instruments\DIAdem 2014\DIAdem.exe"
set script="ConvertDATtoMAT.VBS"

start "" %program% "/cScriptStart('%script%')"

 

thanks a lot

Eagle123

0 Kudos
Message 4 of 5
(872 Views)

Hello again,

 

miraculously the function

Call ProgramExit()

worked fine once i changed my batchfile using an adaptable working directory for the script:

 

set script="%~dp0\ConvertDATtoMAT.VBS"

start "" %program% "/cScriptStart('"%script%"')"

Cheers

 

Eagle123

0 Kudos
Message 5 of 5
(733 Views)