Having spaces is not a problem in the method I suggested...it can be a problem with the method you are using.
>There may be spaces, which is why I need to use this method.
>
>>James,
>>
>>I don't know why its not working, but I'd suggest that you eliminate macro substition completely. Are there spaces in lcCommand?
>>
>>
>>DO (lcCommand)
>>
>>>Can anyone tell me why the following code works in debug but not in the exe?
>>>
>>>lcFile = ALLTRIM(cText)
>>>lcPrg = JUSTSTEM(lcFile) + ".prg"
>>>lcCommand = "'" + lcPrgDir + lcPrg + "'"
>>>DO &lcCommand
Steve Gibson