Hello All,
I'm trying to execute series of command read from a file using perl.
Below is a sample file
(NOTE: I don't want to use Windows batch script to execute the commands, actual file contains more than 200 lines which is generated based on some configuration during build)
Ex: Sample file contents are as below -
Line 1: set Build_DIR=c:\build_proj1
Line 2: md %Build_DIR%
Line 3: cd %Build_DIR%
Line 4: copy c:\proj\*.* c:\build_proj1
Line 5: dir
LINE 6: {TOOLPATH}\catalyst.exe /E "{CODEDIR}\proj1
\dir1\#catexe
2#\#catexe[0]#_multilang.ttk" "{CODEDIR}\bin\#catexe
2#"
LINE 7: {SIGNPATH}\signtool.exe proj1.msi "Proj1 Digital Signature"
LINE 8: call test_it.bat
etc.
Before executing the above commands I have to replace the tokens {TOOLPATH}, {CODEDIR} ,{SIGNPATH}, #catexe
2# etc.
Also for some commands (ex; signtool.exe) if they fail, retry the command execution for 5 times and return the status.
Please help, how to execute the commands in a shell(cmd.exe) and get the output(including errors) and execution status of each command.
Regards,
SSDP