<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Start Codesys project and then execute python script from command line</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/838c617e25/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/838c617e25/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/838c617e25/</id><updated>2024-09-30T08:21:11.916000Z</updated><subtitle>Recent posts to Start Codesys project and then execute python script from command line</subtitle><entry><title>Start Codesys project and then execute python script from command line</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/838c617e25/?limit=25#0836" rel="alternate"/><published>2024-09-30T08:21:11.916000Z</published><updated>2024-09-30T08:21:11.916000Z</updated><author><name>micik</name><uri>https://forge.codesys.com/u/micik/</uri></author><id>https://forge.codesys.come237b85cc94a9b3f1175df8a5d10522121270c62</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br/&gt;
by searching the forum, I have found an example of batch script that can be used to start codesys projct by temporarily setting env variables.&lt;/p&gt;
&lt;p&gt;However, I'm not sure how to modify this to start Codesys 3.5.20 and whether or not I need to specify "profile" with Codesys version at all.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;@echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PROJECT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nl"&gt;D&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;TestScripts&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="k"&gt;Data&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;OnlineTest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VARIABLES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;POU&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;testint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;POU&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;testoutput&lt;/span&gt;
&lt;span class="k"&gt;start&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;wait&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CoDeSys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;--profile="CoDeSys V3.4 SP3" --noUI --runscript="D:\TestScripts\Forum_Environment.py"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I have tried the following:&lt;br/&gt;
start CODESYS.exe --profile="CODESYS V3.5 SP20 Patch 2" "C:\TEST\Example.project"&lt;br/&gt;
And indeed Codesys starts, but the project is not open.&lt;br/&gt;
Can you point out what I'm doing wrong?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>