I am trying to call the logoff command from my build.xml. I tried several combinations in my ant target such as :
<target name="bat">
<echo>Executing batch script</echo>
<exec dir="C:\WINDOWS\system32" executable="cmd">
<arg value="/c"/>
<arg value="logoff"/>
</exec>
</target>
But everytime, I get this error : "logoff is not recognized as an internal or external command, operable program or batch file"
I don't know how to fix this issue. Thanks for helping.
EDIT:
logoff.xml
<?xml version="1.0"?>
<project name="logoff" default="off" basedir=".">
<target name="off">
<exec executable="cmd">
<arg value="/c"/>
<arg value="logoff"/>
</exec>
</target>
</project>
logoff_xml.bat:
@echo off
set ANT_HOME=W:\lib\org.apache.ant
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_24
set PATH=%PATH%;%ANT_HOME%\bin
set BUILD_PATH=W:\logoff.xml
set ANT=call ant -buildfile %BUILD_PATH%
%ANT%
pause
echo %PATH% (with buid.xml bat target)
[exec] C:\Outils\GPS_510\bin;C:\Outils\GNATPRO_6.1.2\bin;C:\WINDOWS\system3
2;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Outils\Python25;C:\MinGW\bin;C:\Program
Files (x86)\IBM\RationalSDLC\common;C:\Program Files (x86)\IBM\RationalSDLC\Cle
arCase\bin;C:\Program Files (x86)\doxygen\bin;C:\Program Files (x86)\Citrix\Syst
em32\Citrix\IMA;C:\Program Files (x86)\Citrix\System32\Citrix\IMA\Subsystems;C:\
WINDOWS\System32\Citrix\IMA;C:\Program Files (x86)\Citrix\system32;C:\Program Fi
les (x86)\commonfiles\Citrix\System32\;C:\MinGW\msys\1.0\bin;c:\outils\cygw
in\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files (x86)\commonfiles
\Citrix\System32;C:\Program Files (x86)\Java\jre6\bin;lib\org.apache.an
t\bin
EDIT : When I launch logoff with Ant, I got :
[exec] Disconnecting
[exec] "logoff.exe is not recognized as an internal or external command, operable program or batch file"