Return value in windows

Hi, i’m novice to rclone. Can you help me?

I’m trying to make a script (powershell or bat… backup of some data). So, I’m trying to get job’s return values, but I get nothing at all.
Maybe I’m doing something wrong, help me, please (By the way, sorry for my English):
The Powershell script:

$temp =0;
&c:\rclone\rclone.exe copy c:\rclone\1.txt test: |%{$temp = $_}

if(($temp -eq 0) -or ($temp -eq $null)){
Write-Host “Succeded”;}
Write-Host “Some error happened…”;

| tried to make it thru the Invoke-expression. And I didn’t get any result.
I tried to get return value by the cmd/bat script… Nothing.

I’m not really a Windows person, but I thought %ERRORLEVEL% was the way to do it in .bat scripts.

rclone should return error codes in Windows - haven’t actually tested that though!

I’ve tested just now. And I feel myself so stupid. )))

I did it 4 hours ago and I didn’t understand what that mean.

Thanks a great.

1 Like