Launching batch file from BOARD 10.5.1

Hi,

 

I am trying to launch a .bat file using a server side launch procedure to run a python script on the server. The batch file runs when it is manually launched on the server, however it doesn't run when called via the BOARD procedure. I was wondering if anyone else had experienced similar / has been able to launch batch files in the latest version of BOARD?

 

Thanks,

Stephen

Answers

  • Hi Stephen Kirk,

     

    in my experience things like that are usually related to the user rights. Probably the windows user running the Board Engine misses certain privileges?

     

    Maybe this helps.

     

    BR

    Sebastian

  • Samuele Marchetto
    Samuele Marchetto Active Partner
    Third Anniversary 100 Likes 10 Comments 5 Up Votes
    edited March 2020

    Hi, 

     

    to launch .bat scripts Board user must have the parameter "Allow execution of security critical procedures" checked in Board Security:

     

    image

  • Stephen Kirk
    Stephen Kirk Active Partner
    10 Comments Second Anniversary Level 200: Building A Planning Solution in Board Level 100: Foundations of Building in Board

    Hi,

     

    Still not able to get the batch file to run.

     

    Sebastian Gurt - I have tried running the BOARD engine with administrator account privileges

    Samuele Marchetto - I have confirmed this option is enabled on the BOARD account I am using to run the procedure

     

    Can I get anyone to confirm they have got this functionality working on the latest version of BOARD 10?

     

    Thanks,

    Stephen

  • Sebastian Gurt
    Sebastian Gurt Employee
    Fourth Anniversary 100 Likes 10 Comments 25 Up Votes
    edited March 2020

    Hi Stephen Kirk,

     

    yes I can confirm that it works. I just performed a simple test on my local machine:image

    image

    The file is located at \Board\Job and the .txt file was successfully created.

     

    I use this version (it was the latest until the patch release from yesterday):

    image

     

    Did you run the Board engine in you own user context? Maybe you could reduce the scenario to a simple case like above to check if it is a problem with your script.

     

    Like I said before - in my experience these things are usually related to rights management on windows level. Can you try it on a different environment, maybe your local machine?

     

    BR

    Sebastian

  • Stephen Kirk
    Stephen Kirk Active Partner
    10 Comments Second Anniversary Level 200: Building A Planning Solution in Board Level 100: Foundations of Building in Board

    Thanks for the response Sebastian, it's very helpful that I can narrow down what is preventing the batch that I am trying to execute.

     

    That batch file did work for me, so I'm thinking it has something to do with the nature of what I am trying to do with my other files and security as you say. I have tried:

     

    • Launching an exe (python script) located outside of the job directory
    • Launching an exe (python script) located inside of the job directory
    • Launching internet explorer on the server
    • Launching the console and printing to it on the server
  • Stephen Kirk
    Stephen Kirk Active Partner
    10 Comments Second Anniversary Level 200: Building A Planning Solution in Board Level 100: Foundations of Building in Board

    Hi,

     

    I have identified that lines in a batch file that require another program are what is not working from BOARD. Does anyone have any tips to succesfully launch another program from a batch that is used in a BOARD procedure. For example, the batch file:

     

    copy /y NUL TaskStarted.txt >NUL
    START D:\BOARD\Job\test.exe
    copy /y NUL TaskCompleted.txt >NUL

    notepad 'D:\BOARD\Job\TaskCompleted.txt'

     

    Will preform lines 1 and 3 successfully when launched through BOARD, but the launched exe on line 2 does not run as expected (this has dependencies on another program). Neither does line 4 which attempts to open the saved txt file in Notepad. Note that the BOARD service is set to use the administrator account, and the code operates correctly when manually run on the server. Has anyone been able to launch another program server-side via the use of batch files?

     

    Cheers,

    Stephen

  • Glenn De Weerdt
    Glenn De Weerdt Active Partner
    Fourth Anniversary First Comment
    edited February 2021
    Hi Stephen,

    Did you have any luck solving this problem?

    I am in the exact same situation at a project right now. I need my batch file to launch another program, but this is not working through Board.

    Kind Regards,
    Glenn

    ------------------------------
    Glenn De Weerdt
    BI Consultant
    Acumen Consulting BVBA
    Belgium
    ------------------------------
    -------------------------------------------
  • Andreas Rehmer
    Andreas Rehmer Active Partner
    Second Anniversary First Comment Photogenic
    edited March 2021
    Hi Stephen,

    for line two could you explain what test.exe would do normally?

    Regarding line 4, I checked this on my side. I am using Board 10.7 but I think this should not be a problem.

    I created an simple bat file only with the following line: notepad 'Test1.txt' when I run this throug an server command it works as expected. Only point is that there will be no notepad that opens. Background is that notepad is started in the context of the user that runs the board service. I could only see that it works throug the task manager. Could you check if you see the notepad.exe process within the task manager?

    So in general I would say it is possible to run another program via an server command as already mentioned. But it is important to remember that the program is executed in the background so programs like notepad and internet explorer will probably start but you will not see anything. Also if the Board Server is running with the SYSTEM user (that is the default) you are not able to access any network folders and so on.

    image

    Kind regards

    ------------------------------
    Andreas Rehmer
    Senior BI-Entwickler und ERP Berater
    XAX Managing Data & Information GmbH
    Germany
    ------------------------------
    -------------------------------------------
  • Stephen Kirk
    Stephen Kirk Active Partner
    10 Comments Second Anniversary Level 200: Building A Planning Solution in Board Level 100: Foundations of Building in Board
    edited March 2021
    I did figure out a work around - I hope you figured out something as well!
    • Instead of calling the external program in the .bat which did not work - I created an 'event' that would be viewable by the windows event viewer
    • I created a scheduled task which then launches whenever this event is created. In this task - it calls the program to run
    I used this to convert pdf files that are generated by BOARD to convert them to image files and allow them to be updated on the intranet.

    Cheers,
    Stephen

    ------------------------------
    Stephen Kirk
    Consultant
    BI5 Solutions
    Australia
    ------------------------------
    -------------------------------------------