ExitCode in system command

Advertisement

shivasankari.kandasami@gmail.com
Joined:
Posts:
1
Location:
Chennai

ExitCode in system command

I am trying winscp through loadrunner (testing tool based on C), using system command . The system command in turn calls a batch script and all my winscp commands are written in this batch script.
I am basically doing a upload and stat check for the file presence.
But to validate this in Loadrunner, i need to get a return value from batch script to the loadrunner.
I read that ExitCode gives the return. But i want to know how to get it working through system command.
My basic system command in loadrunner with arguments is as follows. i want to include ExitCode here

sprintf(command, "winscp.bat %s %s",lr_eval_string("{UserName}"),lr_eval_string("{Password}"));
system(command);

Ref i got with PHP is as follows
<?
system("winscp.com /script=example.txt", $exitcode);
 
if ($exitcode == 0)
{
    echo "success\n";
}
else
{
    echo "error\n";
    // handle an error
}
?>

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum