Author |
Message |
Smiffy
Joined: 30 Jan 2011 Posts: 1
|
Posted: Sun Jan 30, 2011 12:40 pm Post subject: Writing an exit code using before script to stop comparison |
|
|
Hi, please excuse my vb knowledge here, which is somewhat shaky. I am trying to set up a message box that runs before comparison which asks if you want to execute the vv profile or just exit. I use vvengine to run my profiles. The help file states that "If a custom script returns an exit code that is not equal to zero, ViceVersa stops comparison and execution". So I am trying to go down this route, by setting the VV_EXIT_CODE in a script before comparison. Its not working though. Below is my script. Can anyone help on what I might need to do? Again, apologies for poor vb knowledge.
Set WshShell = WScript.CreateObject("WScript.Shell")
dim stopexecutioncode
dim mymsg
dim msgcontent
stopexecutioncode = 1
msgcontent = "The teaching files synchronisation is about to start. Do you want to run the synchronisation?" & vbNewLine _
& vbNewLine _
& "If yes, once the teaching files have synchronised automatically a message will appear reporting success or errors. A window will then appear to manually check personal files. Either execute this or just close it if there is nothing to synchronise. A message will confirm that the synchronisation is complete at the end."
mymsg = MsgBox(msgcontent, 4, "Start Synchronisation?")
If mymsg = 7 Then
WshShell.Environment("PROCESS").Item("VV_EXIT_CODE") = stopexecutioncode
End If
Thanks. |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8759
|
Posted: Mon Jan 31, 2011 1:10 am Post subject: |
|
|
Hi, VVEngine runs profiles in hidden mode: the message box would not appear. I think it would be better to use VVScheduler.
thanks _________________ --
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com |
|
Back to top |
|
|
Guest
|
Posted: Mon Jan 31, 2011 10:30 pm Post subject: |
|
|
On the contrary, the message box does appear in all scripts attached to profiles executed through VVEngine. So that part works fine. What I need to identify is how to set the exit code and stop the profile running via the script. It looks like it should be quite possible. Any ideas? |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8759
|
|
Back to top |
|
|
|