Topic "Schedule a session as a task"

Author Message
natzol
[View user's profile]

Joined: 2007-01-18
Posts: 2
Location: Florida, USA
Hello

I am trying to create a script to be executable via batch file on NT schedule. Found following samples for a command line:

Code:

:: winscp3.exe stored_session

:: winscp3.exe [(scp|sftp)://][user[:password]@]host[:port][/path/[file]] [/privatekey=key_file] [/script=script_file]


Is there a way to create a session with all of those parameters so Task will only execute the line like:

Code:
winscp3.com SessionName1
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
You can preconfigure the session from GUI. Please read this FAQ to avoid common mistakes.
_________________
Martin Prikryl
natzol
[View user's profile]

Joined: 2007-01-18
Posts: 2
Location: Florida, USA
Great! Thank you for pointing in the right direction.
I exported settings from registry and found session record:

[HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions\MySite]
"HostName"="www.mySite.com"
"PingType"=dword:00000000
"LocalDirectory"="C:%5CBatch"
"UpdateDirectories"=dword:00000001
"Password"="A35C....21"
"UserName"="username"
"PublicKeyFile"="C:%5CBatch%5CprivateKey.ppk"

It also took a while to find how to switch from Registry settings to INI settings (Panel\Preferences\Other General Options\Storage\Configuration Storage..) Once I changed it - I also found INI file and my session settings in it:

[Sessions\MySite]
PingType=0
HostName=www.mySite.com
Password=A35C....21
UserName=username
PublicKeyFile=C:%5CBatch%5CprivateKey.ppk

Plus I changed
[Configuration\Interface]
RandomSeedFile=.\winscp.rnd
DDTemporaryDirectory=.\


So do you recommend use INI file over Registry? Or overwise export/import registry file each time I need to switch the session so program wont get tied to a current user settings?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
natzol wrote:
So do you recommend use INI file over Registry? Or overwise export/import registry file each time I need to switch the session so program wont get tied to a current user settings?

INI file is probably easier to use for your task.
_________________
Martin Prikryl
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