Yes, my fault, but should it work in both directions.
Just comment out the exec function.
Publish the code below and run it with cmd.exe
Then you get exactly that what you need, maybe.
Make sure, that the cmd.exe window is active.
int main(){
//exec("c:\\windows\\system32\\cmd.exe",NULL); wait(-3);
while(!sys_active("c:\\windows\\system32\\cmd.exe"))wait(1);
sys_message("cd /..[Enter]");
sys_message("cls[Enter]");
sys_message("dir[Enter]");
}