I'm trying to use cmd.exe to get Userdomain and Username from %userdomain% and %username% parameters, and put this in a text file to be able to get back the datas.
it works well when I manually launch a command windows and type: echo %userdomain%\%username% > "C:\Users\MyUserName\AppData\Local\Temp\is-B7P3P.tmp\domainstring_results.txt"
It works well too if a put it in a batch file and launch the .bat
But if I do the same with the Exec function, it only launches cmd.exe and do nothing else :
CommandLine := 'echo %userdomain%\%username% > "' + ExpandConstant('{tmp}') + '\domainstring_results.txt"';
Exec('cmd.exe', CommandLine, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
I don't want to use a batch file because I want to use temporary folder of the installer, so I can't create the batch before the installer compilation. Cannot be in [Run] section too because I need this information before the Install step...