Topic "Running a .bat script via WinSCPNet.dll"

Author Message
joelignall
[View user's profile]

Joined: 2011-11-16
Posts: 9
Location: Work
Hello, we are no longer getting the time out error, thanks for the help. Our latest issue is not being able to run a string of script commands. We were executing .bat scripts in the past to run commands on the UNIX server using the old method of WinSCP.com. A sample of how we used to do it is below. Is there some way we can run a string of commands using the new WinSCPNet.dll?

Dim SftpProcess As Process = New Process()
With SftpProcess.StartInfo
.FileName = "WinSCP.com"
.UseShellExecute = False
.RedirectStandardInput = True
.CreateNoWindow = True
End With

SftpProcess.Start()
With SftpProcess.StandardInput
.WriteLine(UserOpenSessionString)
.WriteLine("call /alps/system/upd_add.ksh")
.WriteLine("exit")
.Close()
End With
SftpProcess.WaitForExit()
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
I assume you mean "shell script", not ".bat script", right?

If you are looking for a call replacement, use Session.ExecuteCommand:
http://winscp.net/eng/docs/library_session_executecommand

The replacements are documented in "Converting to .NET Assembly" sections:
http://winscp.net/eng/docs/scriptcommand_call#net
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