This is untested, but should work:
Code:
if %arg%
  set lower abcdefghijklmnopqrstuvwxyz
  set upper ABCDEFGHIJKLMNOPQRSTUVWXYZ
  if %cmd% == cap
    set firstletter %arg.charat(1)%
    if %lower.contains(%firstletter%)%
      set i 1
      while %i% < 27
        eval lettercheck %lower.charat(%i%)%
        if %lettercheck% == %firstletter%
          break
        end
        eval i %i% + 1
      done
      set newfirst %upper.charat(%i%)%
      set length %arg.strlen%
      set ii 2
      set word %newfirst%
      while %ii% <= %length%
        set word %word%%arg.charat(%ii%)%
        eval ii %ii% + 1
      done
    else
      %echo% This argument doesn't begin with a lowercase letter.
    end
  end
else
  %echo% You need to type 'cap' followed by another word for this script to work.
end
 
29 lines is a bit longer than I'd like, but it's still much shorter than:
Code:
set firstletter %arg.charat(1)%
if %firstletter% == a
  set newfirst A
elseif %firstletter% == b
  set newfirst B
...
 
as that route would be close to 100 lines (it'd be 50+ before rebuilding the rest of the word which mine already has included in its 29 lines).