I created a batch file for compiling Compact Framework projects written using Delphi.

The file was named CF.cmd, and placed in C:\Program Files\Borland\BDS\3.0\CFPreview\bin. With a sample project Test.bdsproj placed in C:\CF, I compile it like such,

C:\Program Files\Borland\BDS\3.0\CFPreview\bin> CF C:\CF\Test

@echo off
ECHO *********************************************************
ECHO ******** Written by Chua Chee Wee                 *******
ECHO ******** CMD batch file for compiling CF projects *******
ECHO ******** To be used on Windows XP / 2003 Server   *******
ECHO * Usage: CF FullProjectName                       *******
ECHO *    Eg: CF C:\CF\TimeZone.dpr                    *******
ECHO *    Eg: CF C:\CF\TimeZone                        *******
ECHO *    Eg: CF C:\CF\TimeZone.bdsproj                *******
ECHO *********************************************************
SETLOCAL

IF "%1"=="" GOTO NOPARAMS
SET EXT=
IF EXIST %1\NUL GOTO Directory
IF /i "%~x1"==".bdsproj" SET EXT=.dpr
SET F=%~dp1%~n1%EXT%
IF EXIST %F% GOTO FilenameResolved
GOTO TryDpr
:Directory
:TryDpr
IF "%~x1"=="" SET EXT=.dpr
SET F=%~dp1%~n1%EXT%
IF EXIST "%F%\NUL" GOTO TryDpk
IF NOT EXIST "%F%" SET EXT=.dpk
GOTO SkipSetDpk
:TryDpk
ECHO TryDpk
SET EXT=.dpk
:SkipSetDpk
SET F=%~dp1%~n1%EXT%

IF EXIST "%F%" GOTO FilenameResolved
SET MSG=Filename not resolved
GOTO FilenameUnresolved
:FilenameResolved
SET MSG=

:FilenameUnresolved
IF NOT "%MSG%"=="" ECHO %MSG%
IF NOT "%MSG%"=="" GOTO INVALIDNAME
REM ECHO %~dp1

SET SearchPath="%~dp1;C:\Program Files\Borland\BDS\3.0\CFPreview\lib"

REM ECHO %SearchPath%

SET AsmPath=C:\Program Files\Borland\BDS\3.0\CFPreview\assemblies\
SET Assemblies="%AsmPath%system.dll;%AsmPath%system.windows.forms.dll;%AsmPath%System.Drawing.dll"
SET OutputPath="C:\CF"
SET CFPreviewBin=C:\Program Files\Borland\BDS\3.0\CFPreview\bin\

IF "%F%"=="" GOTO NOPARAMS

SET Params=%F% -u%SearchPath% -lu%Assemblies% -E%OutputPath% -H -I%SearchPath% -R%SearchPath%
ECHO %Params%
"%CFPreviewBin%dccil.exe" %Params%
:DONE
GOTO COMPLETE
:INVALIDNAME
echo You provided an invalid filename or a project that doesn't exist!
GOTO COMPLETE
:NOPARAMS
echo You need to provide a project to compile!!!
:COMPLETE
ECHO Press a key to complete this task
PAUSE
ENDLOCAL