Page 1 of 1

run/open a robotask tsk using Visual Basic?

Posted: Sat Feb 01, 2020 6:49 pm
by reboot619
How do I run/open a robotask tsk using Visual Basic?
I tried shelling a batch file and it runs but never fully does what it was supposed to do

Re: run/open a robotask tsk using Visual Basic?

Posted: Sat Feb 01, 2020 8:57 pm
by Oleg
Run batch file is the simplest way
but never fully does what it was supposed to do
What is the problem?

Re: run/open a robotask tsk using Visual Basic?

Posted: Mon Feb 03, 2020 12:51 am
by reboot619
The problem is this
when I use this macro outside of being called from Visual Basic, that macro works just fine.
When I call this macro from a batch file inside of Visual Basic a black screen comes up flashes and ends, and then the task is never executed

Re: run/open a robotask tsk using Visual Basic?

Posted: Mon Feb 03, 2020 7:21 am
by reboot619
https://robotask.com/forum/viewtopic.ph ... FACE#p6185
this link is very close to my experience.

Re: run/open a robotask tsk using Visual Basic?

Posted: Mon Feb 03, 2020 11:30 am
by Oleg
You can RoboTask.App object. Read more about RoboTaskApp here

Below is an example of the script

Code: Select all

Set obj = CreateObject("RoboTask.App")
obj.startTask "TestTask1", ""
RoboTask is 32-bit application, so this script works wrom 32-bit applications too.
You can write VBS file with same script and run it by command line

Code: Select all

C:\Windows\SysWOW64\wscript.exe RunTask.vbs 
C:\Windows\SysWOW64\wscript.exe is the 32-bit version of script engine