in reply to Re^2: scp file from windows10 to unix server
in thread scp file from windows10 to unix server

I got not recognized as an internal or external command error when I use just scp.exe instead of absolute path,

If you want to run the command as simply scp.exe or scp then you'll need to add C:/Windows/System32/OpenSSH to the PATH:
set PATH=%PATH%;C:\Windows\System32\OpenSSH
But I am able to run it in cmd line without issues

Yes, I understand that.
I'm just saying that when I've struck this type of issue in the past, the first approach that haukex suggested of replacing system($cmd) with system(@cmd) has often worked for me.
That's the first thing I'd be trying.
Oh ... and use warnings; if they're not already enabled.

Cheers,
Rob