Trying to run a program interactively from a batch file

Running Windows 7 pro on a HP z230 computer

I am trying to get a program to run in batch mode.
The batch file is very simple.
I have attached it as AmibrokerData bat.txt

The batch file runs a vbs file.  I have attached the vbs file as Amibroker_100vbs.txtAmibroker_100vbs.txtAmibrokerData-bat.txt.  This vbs file runs a program called Amibroker.

When I launch the batch file interactively, it runs successfully.
When I schedule the batch file to run, nothing happens.

Amibroker cannot run in the background; it has  to open and display on the screen.
I think the problem is Amibroker cannot run interactively when the batch file is scheduled.

Amibroker requires administrator privileges in order to execute.

What commands could I put into a batch file to allow the vbs script in the batch file to run interactively from a scheduled batch file?
donpickAsked:
Who is Participating?
 
John TsioumprisSoftware & Systems EngineerCommented:
Well you can wrap the vbscript with administrative privileges and create an .exe that does the job..the procedure is described here and i can assure you that it works because i had the exact same issue...
0
 
Andrew LeniartSenior EditorCommented:
In scheduled tasks on the General Tab, under "Security Options" try scheduling the task with a user account that has Administrative privileges rather than using the INTERACTIVE user/group. Also select "Run with highest privileges"  Does that help?
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
Change the bat to the following, change the timeout and run it with NSSM - the Non-Sucking Service Manager https://nssm.cc/

:Start
rem:  ====================== AmibrokerData - export data from Amibroker to CSV file ================

cd \
cd Amibroker_Project

rem:  Cscript Amibroker_100.vbs SP500Param.txt
Call Amibroker_100.vbs SP500Param.txt

timeout 900
Goto Start

Open in new window

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
donpickAuthor Commented:
Mr Leniart:
  Thank you for your suggestion.  I tried this and it did not work.

Mr. Tsioumpris:  
  Thank you for the link.  I never have heard of this idea.

Mr. Vemaak:  
  You say to change the timeout.  Change it to what???   Please provide details.  I know nothing about the Non Sucking Service manager.
0
 
donpickAuthor Commented:
Mr. Tsioumpris:
  My vbs requires a parameter file  (you can see this parameter file in my bat file.)

  If I use your idea,  how do I feed the parameter file to the exe file once it is created?
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
You say to change the timeout.  Change it to what???
Anything you want. 900 in example is 15min
0
 
donpickAuthor Commented:
Thank you all for your answers.  I appreciate your prompt replies.  I will work with this information.  If I need further help I will post more questions.
0
 
John TsioumprisSoftware & Systems EngineerCommented:
In order to pass arguments to VBScript you need
WScript.Arguments

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.