#DEFINE SW_HIDE 0 DECLARE Long ShellExecute IN "Shell32.dll" ; Long hwnd, String lpVerb, String lpFile, ; String lpParameters, String lpDirectory, Long nShowCmd lcOldDir=Fullpath(Curdir()) && remember original folder MKDIR C:\TEST && Make sure directory exists. lcDir = "c:\test" && directory in which command is executed lcCmd = GetEnv("comspec") lcPrm = "/c echo hello >> mytest.txt" =ShellExecute(0, "", lcCmd, lcPrm, lcDir, SW_HIDE) cd (lcOldDir)Basically the above should be similar to: