‎27-07-2022 10:03 AM
Hello, I have created VBscript that called Hopex function (such as: GetCollection, GetSelection, etc.), currently it run from Hopex Script Editor. How to make the VBS to be executable from Windows or run it from Windows Job Scheduler?
Thank you in advance.
Andry
Solved! Go to Solution.
‎01-08-2022 03:53 AM
Hello,
you can use the following sample script to create VBS file to be used with windows scheduler. You can also use following documentation links as reference
‘Start of the application
Dim myApp, myEnv, myBase, myMegaRoot, oWS
    Set myApp = CreateObject("Mega.Application")
    Set myEnv = myApp.Environments.Item(ENVPATH)
    myEnv.CurrentAdministrator = USERNAME
    If PASSWORD <> "" Then
      myEnv.CurrentPASSWORD = PASSWORD
    End If
    Set myBase = myEnv.Databases.Item(REPOSITORY)
     Set myMegaRoot = myBase.Open
‘Code to generate files
myMegaRoot.callMethod ……
‘End of the Application
set myMegaRoot = nothing
set myEnv = nothing
set myApp = nothing