from delphi i call this next function

function ExecAndWait(resultDirtring;const CmdLinehortString;Const WinState: Word):boolean; export;

for example variable resultDIR has within directory like \auto main\
for that directory i cannoot get tru result from this function

how to corectly convert long filenames into short

copy(longfilename,1,6)+'~1' - this way i must always to use or not ?

thanks !