Scripting with use of .ini file

Advertisement

cristian.fuchs@itk-rheinland.de
Joined:
Posts:
5
Location:
Germany

Scripting with use of .ini file

We moved our configuration to a new server with new WinSCP 5.21.7
I imported the old ini file and everything is working with the GUI.
But it seems our old scripts refuses by reading the .ini file
WinSCP Version 5.21.7 (Build 12963 2023-01-23) (OS 10.0.20348 - Windows Server 2022 Standard)
Configuration: \\server\c$\Program Files (x86)\WinSCP\winscp.ini
In the new log it shows
 Session name: MGL-XXX-RD-ELIA (Ad-Hoc site)
and it doesn't resolve the host name.

The old log shows
Session name: MGL-CEVAS-RD-ELISABETH (Modified site)
and it resolves the hostname

Somebody an idea?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,884
Location:
Prague, Czechia

Re: Scripting with use of .ini file

The INI file cannot cause your script trying to load a different session. Your scripts must have changed. Make sure the script loads the session that matches your INI file.

Reply with quote

cristian.fuchs@itk-rheinland.de
Joined:
Posts:
5
Location:
Germany

Sorry, was a mistake while copy and paste ;)
Old log:
Session name: MGL-XXX-RD-ELIA (Ad-Hoc site)
New log
Session name: MGL-MGL-XXX-RD-ELIA (Modified site)
The script doesn't changed. Just an new installation (server and WinSCP)

Reply with quote

cristian.fuchs@itk-rheinland.de
Joined:
Posts:
5
Location:
Germany

New log:
Session name: MGL-XXX-RD-ELIA (Ad-Hoc site)
Old log
Session name: MGL-XXX-RD-ELIA (Modified site)
Sorry my mistake. I am not allowed to post the full log.
But it must have something to do that the credentials will not included for the connection in the new installation.

Reply with quote

Advertisement

cristian.fuchs@itk-rheinland.de
Joined:
Posts:
5
Location:
Germany

Full log

. 2023-10-06 08:51:53.317 --------------------------------------------------------------------------
. 2023-10-06 08:51:53.317 WinSCP Version 5.21.7 (Build 12963 2023-01-23) (OS 10.0.20348 - Windows Server 2022 Standard)
. 2023-10-06 08:51:53.317 Configuration: \\msbmcc07\c$\Program Files (x86)\WinSCP\WinSCP.ini
. 2023-10-06 08:51:53.317 Log level: Normal
. 2023-10-06 08:51:53.317 Local account: ITK\controlm
. 2023-10-06 08:51:53.317 Working directory: \\msbmcc07\c$\Program Files (x86)\WinSCP
. 2023-10-06 08:51:53.317 Process ID: 3400
. 2023-10-06 08:51:53.332 Ancestor processes: powershell, cmd, p_ctmam, p_ctmag, ...
. 2023-10-06 08:51:53.332 Command-line: "\\msbmcc07\c$\Program Files (x86)\WinSCP\winscp.exe" /xmllog="C:\Users\controlm\AppData\Local\Temp\wscp1BC4.00184AA1.tmp" /xmlgroups /xmllogrequired /nointeractiveinput /stdout /stdin /dotnet=5.21.7  /ini="\\msbmcc07\c$\Program Files (x86)\WinSCP\WinSCP.ini" /log="c:\temp\MGL-CEVAS-RD-WinSCP-To-ELISABETH_winscp.log"  /console /consoleinstance=_7108_58902858_192
. 2023-10-06 08:51:53.332 Time zone: Current: GMT+2, Standard: GMT+1 (Mitteleuropäische Zeit), DST: GMT+2 (Mitteleuropäische Sommerzeit), DST Start: 26.03.2023, DST End: 29.10.2023
. 2023-10-06 08:51:53.332 Login time: Freitag, 6. Oktober 2023 08:51:53
. 2023-10-06 08:51:53.332 --------------------------------------------------------------------------
. 2023-10-06 08:51:53.332 Script: Retrospectively logging previous script records:
> 2023-10-06 08:51:53.332 Script: option batch on
< 2023-10-06 08:51:53.332 Script: batch           on        
< 2023-10-06 08:51:53.332 Script: reconnecttime   120       
> 2023-10-06 08:51:53.332 Script: option confirm off
< 2023-10-06 08:51:53.332 Script: confirm         off       
> 2023-10-06 08:51:53.332 Script: option reconnecttime 120
< 2023-10-06 08:51:53.332 Script: reconnecttime   120       
> 2023-10-06 08:51:53.332 Script: open "sftp://MGL-XXX-RD-ELIA" -timeout=15
. 2023-10-06 08:51:53.332 --------------------------------------------------------------------------
. 2023-10-06 08:51:53.332 Session name: MGL-XXX-RD-ELIA (Ad-Hoc site)
. 2023-10-06 08:51:53.332 Host name: MGL-XXX-RD-ELIA (Port: 22)
. 2023-10-06 08:51:53.332 User name:  (Password: No, Key file: No, Passphrase: No)
. 2023-10-06 08:51:53.332 Tunnel: No
. 2023-10-06 08:51:53.332 Transfer Protocol: SFTP
. 2023-10-06 08:51:53.332 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2023-10-06 08:51:53.332 Disable Nagle: No
. 2023-10-06 08:51:53.332 Proxy: None
. 2023-10-06 08:51:53.332 Send buffer: 262144
. 2023-10-06 08:51:53.332 Compression: No
. 2023-10-06 08:51:53.332 Bypass authentication: No
. 2023-10-06 08:51:53.332 Try agent: Yes; Agent forwarding: No; KI: Yes; GSSAPI: Yes
. 2023-10-06 08:51:53.332 GSSAPI: KEX: No; Forwarding: No; Libs: gssapi32,sspi,custom; Custom: 
. 2023-10-06 08:51:53.332 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2023-10-06 08:51:53.332 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2023-10-06 08:51:53.332 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2023-10-06 08:51:53.332 Simple channel: Yes
. 2023-10-06 08:51:53.332 Return code variable: Autodetect; Lookup user groups: Auto
. 2023-10-06 08:51:53.332 Shell: default
. 2023-10-06 08:51:53.332 EOL: LF, UTF: Auto
. 2023-10-06 08:51:53.332 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2023-10-06 08:51:53.332 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2023-10-06 08:51:53.332 SFTP Bugs: Auto,Auto
. 2023-10-06 08:51:53.332 SFTP Server: default
. 2023-10-06 08:51:53.332 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2023-10-06 08:51:53.332 Cache directory changes: Yes, Permanent: Yes
. 2023-10-06 08:51:53.332 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2023-10-06 08:51:53.332 DST mode: Unix
. 2023-10-06 08:51:53.332 --------------------------------------------------------------------------
< 2023-10-06 08:51:53.332 Script: Fernrechner wird gesucht …
. 2023-10-06 08:51:53.332 Looking up host "MGL-XXX-RD-ELIA" for SSH connection
< 2023-10-06 08:51:54.332 Script: Host „MGL-XXX-RD-ELIA“ ist nicht vorhanden.

Reply with quote

cristian.fuchs@itk-rheinland.de
Joined:
Posts:
5
Location:
Germany

Reply Notification - Scripting with use of .ini file

Back from holiday ;)

The problem is coupling the assembly with WinSCP application configuration.

In the old configuration it worked. But on the new server with new WinSCP install it doesn't work. I know that this way is not wanted, but it will be lot of work to switch it all.
so maybe there is still a way to work with our old config.

Reply with quote

Advertisement

You can post new topics in this forum