Hi, I don't think you can do what you want. When you run cmd.exe with args "/C" and "C:\\setenv.bat", it will execute the command c:\setenv.bat and then exit. You can run another cmd.exe via QProcess, but it will be a new process and won't inherit any of the environmental variables you set in c:\setenv.bat.

You could, however, run a batch file that sets environment variables *and* execute whatever other commands you want in one QProcess invocation.