#DEFINE SW_HIDE 0 DECLARE INTEGER ShellExecute ; IN SHELL32.DLL ; INTEGER nWinHandle,; STRING cOperation,; STRING cFileName,; STRING cParameters,; STRING cDirectory,; INTEGER nShowWindow lcDir=GETENV("APPDATA") lcCmd = GetEnv("comspec") lccdm = "dir" ? lccmd, lcDir lcPrm = " /c qwinsta >> mytest.txt" lcPrm = lcDir+"\mytest.txt" lcPrm = " echo hello >> mytest.txt " =ShellExecute(0, "", lcCmd, lcPrm, lcDir, 0)Thanks in advance