run/open a robotask tsk using Visual Basic?

Discuss RoboTask here
Post Reply
reboot619
Posts: 3
Joined: Sat Feb 01, 2020 6:37 pm

run/open a robotask tsk using Visual Basic?

Post 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
Oleg
Site Admin
Posts: 3010
Joined: Thu Jan 01, 1970 1:00 am
Contact:

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

Post by Oleg »

Run batch file is the simplest way
but never fully does what it was supposed to do
What is the problem?
Oleg Yershov
reboot619
Posts: 3
Joined: Sat Feb 01, 2020 6:37 pm

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

Post 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
reboot619
Posts: 3
Joined: Sat Feb 01, 2020 6:37 pm

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

Post by reboot619 »

https://robotask.com/forum/viewtopic.ph ... FACE#p6185
this link is very close to my experience.
Oleg
Site Admin
Posts: 3010
Joined: Thu Jan 01, 1970 1:00 am
Contact:

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

Post 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
Oleg Yershov
Post Reply