Topic "Scripting error: return code 127 and error message"

Author Message
eaglejon15
[View user's profile]

Joined: 2010-10-12
Posts: 3
using SCP protocol I'm attempting to connect to a server via automation/scripting.

I'm using batch to automate. Below is my script:


Code:
@echo off

echo Connecting to host to download files
echo option batch on > script.tmp
echo option confirm off >> script.tmp
echo open scp://root:%1@%2:2222 -passive >> script.tmp
echo synchronize local <Directory> <Directory> >> script.tmp

echo Executing script
winscp /script=script.tmp

if %ERRORLEVEL% NEQ 0 echo ERROR: %ERRORLEVEL%

echo Delete temporary script
del script.tmp



I always get the below error in my log.

* 2010-10-12 15:29:13.747 (ECommand) Error looking up user groups.
* 2010-10-12 15:29:13.747 Command 'groups'
* 2010-10-12 15:29:13.747 failed with return code 127 and error message
* 2010-10-12 15:29:13.747 -ash: groups: not found.

I'm executing this batch file through perl and always get error code of 1 no matter if successful or NOT.

How do you turn off/unclick lookup user groups through automation?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl
eaglejon15
[View user's profile]

Joined: 2010-10-12
Posts: 3
[quote="prikryl"]Please read [url=https://winscp.net/eng/docs/faq_script_ini]FAQ[/url]. If that does not help, come back.[/quote]

Prikryl,

I have looked through this site extensively and cannot find an answer. This seems like a pretty straight forward question that many people should have encountered. Whenever I connect to a device using the GUI I'm always prompted with an error saying somethng about "command groups". I know that if you do not want this message to come up you must switch protocol to SCP and under Environment -> SCP/Shell uncheck lookup user groups. I want to know a way to do this through automation so my batch script doesn't come back with an error everytime its called.

Regards
eaglejon15
[View user's profile]

Joined: 2010-10-12
Posts: 3
I figured it out by sure dumb luck.

In the GUI under sessions there is a set defaults. I had tryed to save a session like I wanted, then highlight it and try to save as default. This however doesn't work. You must make all your desired changes then go into session and click set defaults. This is not self explainatory, and never saw any of this in the Documentation, but none the less I figured it out after months of dealing with this.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License