Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

shivasankari.kandasami@gmail.com

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
}
?>