Running external program

Created at 10 Oct 2023, 07:21
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MM

MMII

Joined 28.08.2023

Running external program
10 Oct 2023, 07:21


Hi

if I include the following lines in visual studio then the program will open notepad as expected

using System.Diagnostics

Process process = new Process();

process.StartInfo.Filename = “notepad.exe”;

process.Start();

But if I put the same lines of code in ctrader desktop Automate let's say inside OnStart, it does not work and gives the following error

Crashed in OnStart with Win32Exception: An error occurred trying to start process 'notepad.exe' with working directory 'C:\Users\My Username\Documents\cAlgo\Data\cBots\cbot project name'. Unknown error (0x2)

notepad.exe here is just an example to simplify the question, I intend to run scripts.

Any hint and help is greatly appreciated


@MMII
Replies

PanagiotisChar
11 Oct 2023, 06:55 ( Updated at: 11 Oct 2023, 07:00 )

Can you share the complete cBot code you are using?


@PanagiotisChar

firemyst
18 Mar 2024, 01:20 ( Updated at: 18 Mar 2024, 14:40 )

I provided you an example in your other post:

https://ctrader.com/forum/cbot-support/42024

 


@firemyst