Great example from Strawberry Perl's portable shell launcher:
set drive=%~dp0
set drivep=%drive%
if #%drive:~-1%# == #\# set drivep=%drive:~0,-1%
set PATH=%drivep%\perl\site\bin;%drivep%\perl\bin;%drivep%\c\bin;%PATH%
not sure what the negative 1's doing there myself, but it works a treat!