<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Running commands under Windchill Shell from a script in Windchill</title>
    <link>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057726#M88446</link>
    <description>&lt;P&gt;I've never tried to script ant but used .bat for other windchill shell commands like xconfmanager, loadfiles, running cps installer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think ant would be similar, for example the ant command "ant -DHTTPS_ENABLED=true -f config.xml reconfigure" might look like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set "ANT_BIN=%WT_HOME%\ant\bin"&lt;/P&gt;
&lt;P&gt;call "%ANT_BIN%\ant.bat" ^&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-DHTTPS_ENABLED=true ^&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-f config.xml reconfigure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/210422"&gt;@echo&lt;/a&gt; off
setlocal EnableExtensions EnableDelayedExpansion

REM ---- Configure Windchill home ----
set "WT_HOME=E:\ptc\Windchill_13.0\Windchill"
set "WC_BIN=%WT_HOME%\bin"

REM ---- Logging ----
set "LOG=%WT_HOME%\logs\windchill_shell_command.log"

echo.&amp;gt;&amp;gt;"%LOG%"
echo ==================================================&amp;gt;&amp;gt;"%LOG%"
echo %DATE% %TIME% - Starting windchill shell command &amp;gt;&amp;gt;"%LOG%"
echo WT_HOME=%WT_HOME%&amp;gt;&amp;gt;"%LOG%"
echo ==================================================&amp;gt;&amp;gt;"%LOG%"

REM ---- pre-requisite checks ----
if not exist "%WC_BIN%\setvars.bat" (
  echo ERROR: Missing "%WC_BIN%\setvars.bat"
  echo ERROR: Missing "%WC_BIN%\setvars.bat"&amp;gt;&amp;gt;"%LOG%"
  exit /b 10
)

if not exist "%WC_BIN%\xconfmanager.bat" (
  echo ERROR: Missing "%WC_BIN%\xconfmanager.bat"
  echo ERROR: Missing "%WC_BIN%\xconfmanager.bat"&amp;gt;&amp;gt;"%LOG%"
  exit /b 11
)

pushd "%WC_BIN%" || (
  echo ERROR: Cannot cd to "%WC_BIN%"
  echo ERROR: Cannot cd to "%WC_BIN%"&amp;gt;&amp;gt;"%LOG%"
  exit /b 12
)

REM ---- Start the environment ----
call "%WC_BIN%\setvars.bat" &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
set "RC=%ERRORLEVEL%"
if not "%RC%"=="0" (
  echo ERROR: setvars.bat failed with exit code %RC%
  echo ERROR: setvars.bat failed with exit code %RC%&amp;gt;&amp;gt;"%LOG%"
  popd
  exit /b %RC%
)

REM ---- RUN WINDCHILL SHELL COMMANDS  ----

echo Running: windchill shell command
echo Running: windchill shell command&amp;gt;&amp;gt;"%LOG%"

REM ---- Run an xconfmanager command
REM call "%WC_BIN%\xconfmanager.bat" -p &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

REM ---- Run a loadfile command like: windchill wt.load.util.CSV2XML -delimiter ~ -input test.csv ----
REM call "%WC_BIN%\windchill.exe" wt.load.util.CSV2XML ^
REM -delimiter ~ ^
REM -input "doc_migrations.csv" ^
REM &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

REM ---- Run a loadfile command like: windchill wt.load.LoadFromFile -d E:\ptc\Windchill_10.2\Windchill\src\loadFiles\test.xml -u wcadmin -p &amp;lt;pass&amp;gt; -CONT_PATH "/wt.inf.container.OrgContainer=&amp;lt;org&amp;gt;/wt.pdmlink.PDMLinkProduct=&amp;lt;product&amp;gt;"
call "%WC_BIN%\windchill.exe" wt.load.LoadFromFile ^
 -d "E:\ptc\Windchill_13.0\Windchill\src\loadFiles\doc_migrations.xml" ^
 -u wcadmin ^
 -p &amp;lt;pass&amp;gt; ^
 -CONT_PATH "/wt.inf.container.OrgContainer=&amp;lt;org&amp;gt;/wt.pdmlink.PDMLinkProduct=&amp;lt;product&amp;gt;" ^
 &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1

set "RC=%ERRORLEVEL%"

REM ---- Run xconfmanager -p ----
REM call "%WC_BIN%\xconfmanager.bat" -p &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

REM set "WT_HOME=E:\ptc\Windchill_13.0\Windchill"
REM set "WC_BIN=%WT_HOME%\bin"

REM Optional log
REM set "LOG=%WT_HOME%\logs\cps_install.log"

REM ---- Run java
REM echo Running java safe area install... &amp;gt;&amp;gt;"%LOG%"
REM java -jar "%JAR%" --completeSafeAreaInstall "%WT_HOME%" &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

echo Running: windchill shell command done
echo Running: windchill shell command done&amp;gt;&amp;gt;"%LOG%"

popd

if not "%RC%"=="0" (
  echo ERROR: windchill shell command failed with exit code %RC%
  echo ERROR: windchill shell command failed with exit code %RC%&amp;gt;&amp;gt;"%LOG%"
  exit /b %RC%
)

echo Success: windchill shell command completed.
echo Success: windchill shell command completed.&amp;gt;&amp;gt;"%LOG%"
exit /b 0
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2026 10:04:34 GMT</pubDate>
    <dc:creator>rhart</dc:creator>
    <dc:date>2026-03-09T10:04:34Z</dc:date>
    <item>
      <title>Running commands under Windchill Shell from a script</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057217#M88401</link>
      <description>&lt;P&gt;Version: Windchill 13.0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use Case: We have an Ant build script that builds and installs a PDMLink customization package. An engineer connects to a server via Remote Desktop and runs it from within Windchill Shell. We'd like to trigger it from a CD pipeline instead.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been using Windchill Shell interactively, i.e. launching `&amp;lt;WT_HOME&amp;gt;/bin/windchill shell` and then doing everything else in a session that opens.&amp;nbsp;I can't figure out how to launch something (e.g., an Ant build script) under Windchill Shell in a "headless" mode, i.e. from a script (PowerShell, a batch file, a Bash script, ...)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like a common problem and I'm sure people do it all the time, but... how?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Constantine&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2026 08:22:13 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057217#M88401</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2026-03-06T08:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Running commands under Windchill Shell from a script</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057260#M88406</link>
      <description>&lt;P&gt;Not an expert but I think you need to have a runner installed on the Windchill server connected to Github. It can then be listening for requests to run your scripts.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 12:28:18 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057260#M88406</guid>
      <dc:creator>avillanueva</dc:creator>
      <dc:date>2026-03-05T12:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Running commands under Windchill Shell from a script</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057726#M88446</link>
      <description>&lt;P&gt;I've never tried to script ant but used .bat for other windchill shell commands like xconfmanager, loadfiles, running cps installer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think ant would be similar, for example the ant command "ant -DHTTPS_ENABLED=true -f config.xml reconfigure" might look like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set "ANT_BIN=%WT_HOME%\ant\bin"&lt;/P&gt;
&lt;P&gt;call "%ANT_BIN%\ant.bat" ^&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-DHTTPS_ENABLED=true ^&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-f config.xml reconfigure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/210422"&gt;@echo&lt;/a&gt; off
setlocal EnableExtensions EnableDelayedExpansion

REM ---- Configure Windchill home ----
set "WT_HOME=E:\ptc\Windchill_13.0\Windchill"
set "WC_BIN=%WT_HOME%\bin"

REM ---- Logging ----
set "LOG=%WT_HOME%\logs\windchill_shell_command.log"

echo.&amp;gt;&amp;gt;"%LOG%"
echo ==================================================&amp;gt;&amp;gt;"%LOG%"
echo %DATE% %TIME% - Starting windchill shell command &amp;gt;&amp;gt;"%LOG%"
echo WT_HOME=%WT_HOME%&amp;gt;&amp;gt;"%LOG%"
echo ==================================================&amp;gt;&amp;gt;"%LOG%"

REM ---- pre-requisite checks ----
if not exist "%WC_BIN%\setvars.bat" (
  echo ERROR: Missing "%WC_BIN%\setvars.bat"
  echo ERROR: Missing "%WC_BIN%\setvars.bat"&amp;gt;&amp;gt;"%LOG%"
  exit /b 10
)

if not exist "%WC_BIN%\xconfmanager.bat" (
  echo ERROR: Missing "%WC_BIN%\xconfmanager.bat"
  echo ERROR: Missing "%WC_BIN%\xconfmanager.bat"&amp;gt;&amp;gt;"%LOG%"
  exit /b 11
)

pushd "%WC_BIN%" || (
  echo ERROR: Cannot cd to "%WC_BIN%"
  echo ERROR: Cannot cd to "%WC_BIN%"&amp;gt;&amp;gt;"%LOG%"
  exit /b 12
)

REM ---- Start the environment ----
call "%WC_BIN%\setvars.bat" &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
set "RC=%ERRORLEVEL%"
if not "%RC%"=="0" (
  echo ERROR: setvars.bat failed with exit code %RC%
  echo ERROR: setvars.bat failed with exit code %RC%&amp;gt;&amp;gt;"%LOG%"
  popd
  exit /b %RC%
)

REM ---- RUN WINDCHILL SHELL COMMANDS  ----

echo Running: windchill shell command
echo Running: windchill shell command&amp;gt;&amp;gt;"%LOG%"

REM ---- Run an xconfmanager command
REM call "%WC_BIN%\xconfmanager.bat" -p &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

REM ---- Run a loadfile command like: windchill wt.load.util.CSV2XML -delimiter ~ -input test.csv ----
REM call "%WC_BIN%\windchill.exe" wt.load.util.CSV2XML ^
REM -delimiter ~ ^
REM -input "doc_migrations.csv" ^
REM &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

REM ---- Run a loadfile command like: windchill wt.load.LoadFromFile -d E:\ptc\Windchill_10.2\Windchill\src\loadFiles\test.xml -u wcadmin -p &amp;lt;pass&amp;gt; -CONT_PATH "/wt.inf.container.OrgContainer=&amp;lt;org&amp;gt;/wt.pdmlink.PDMLinkProduct=&amp;lt;product&amp;gt;"
call "%WC_BIN%\windchill.exe" wt.load.LoadFromFile ^
 -d "E:\ptc\Windchill_13.0\Windchill\src\loadFiles\doc_migrations.xml" ^
 -u wcadmin ^
 -p &amp;lt;pass&amp;gt; ^
 -CONT_PATH "/wt.inf.container.OrgContainer=&amp;lt;org&amp;gt;/wt.pdmlink.PDMLinkProduct=&amp;lt;product&amp;gt;" ^
 &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1

set "RC=%ERRORLEVEL%"

REM ---- Run xconfmanager -p ----
REM call "%WC_BIN%\xconfmanager.bat" -p &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

REM set "WT_HOME=E:\ptc\Windchill_13.0\Windchill"
REM set "WC_BIN=%WT_HOME%\bin"

REM Optional log
REM set "LOG=%WT_HOME%\logs\cps_install.log"

REM ---- Run java
REM echo Running java safe area install... &amp;gt;&amp;gt;"%LOG%"
REM java -jar "%JAR%" --completeSafeAreaInstall "%WT_HOME%" &amp;gt;&amp;gt;"%LOG%" 2&amp;gt;&amp;amp;1
REM set "RC=%ERRORLEVEL%"

echo Running: windchill shell command done
echo Running: windchill shell command done&amp;gt;&amp;gt;"%LOG%"

popd

if not "%RC%"=="0" (
  echo ERROR: windchill shell command failed with exit code %RC%
  echo ERROR: windchill shell command failed with exit code %RC%&amp;gt;&amp;gt;"%LOG%"
  exit /b %RC%
)

echo Success: windchill shell command completed.
echo Success: windchill shell command completed.&amp;gt;&amp;gt;"%LOG%"
exit /b 0
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2026 10:04:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057726#M88446</guid>
      <dc:creator>rhart</dc:creator>
      <dc:date>2026-03-09T10:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Running commands under Windchill Shell from a script</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1058312#M88481</link>
      <description>&lt;P&gt;Hello &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/304626"&gt;@Constantine&lt;/a&gt;&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you have some &lt;A href="https://community.ptc.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1057726#M88446" target="_blank"&gt;responses&lt;/A&gt; from some community experts. If it helped you solve your question please mark the reply as the Accepted Solution.&amp;nbsp;&lt;BR /&gt;Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Vivek N.&lt;BR /&gt;Community Moderation Team.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 10:02:13 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1058312#M88481</guid>
      <dc:creator>vnamboodheri</dc:creator>
      <dc:date>2026-03-12T10:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Running commands under Windchill Shell from a script</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1058357#M88482</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/205208"&gt;@rhart&lt;/a&gt;&amp;nbsp;, that's exactly what I was looking for!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So all I needed to do in my script was to set WT_HOME and call setvars.bat. It works! Demystifying windchill shell &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Constantine&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 15:04:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill/Running-commands-under-Windchill-Shell-from-a-script/m-p/1058357#M88482</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2026-03-12T15:04:08Z</dc:date>
    </item>
  </channel>
</rss>

