winscp

Enabling text file logging for WinSCP script

泪湿孤枕 提交于 2019-12-08 03:29:42
问题 Hi have a WinSCP script to put a file on remote server using SFTP, which is working fine. But I would enable logging to a text file on a local directory. I have the following script option batch on option confirm off # connect minute session open sftp://xyz.com:22/ -privatekey=E:\PK\*.ppk # force binary mode transfer option transfer ascii # navigate to mediacom and put file lcd "E:\export\" cd /mediacom/testdir put "CI_Tst.tab" # disconnect daily session close # exit WinScP exit Many I know

Avoid downloading subfolders with WinSCP

孤街醉人 提交于 2019-12-08 03:17:11
问题 I am using the below script option batch abort option confirm off open sftp:------- get -filemask=">=%TIMESTAMP#yyyy-mm-dd%" /outbound \\sharedrive\Copiedfiles exit Please let me know how I can copy only files, but not subfolders. The SFTP folder /outbound contains csv files and other subfolders like edi , test , debug . The CSV files are placed daily and these folders also get updated daily. Please let me know how I can copy only the .csv files (I tried options but was not successfully). 回答1

WinSCP command-line passive mode

孤街醉人 提交于 2019-12-08 02:49:45
问题 I am calling WinSCP via command line but I can't figure out how to set passive mode properly to the script. Here is the script now: option batch on option confirm off open ftp://user_and_pass_details:21 cd /out/ option transfer binary put C:\afile.text close exit 回答1: You can specify the passive option in your open: open ftp://user_and_pass_details:21 -passive=on|off Your full script will become: option batch on option confirm off open ftp://user_and_pass_details:21 -passive=on cd /out/

List files with specific extension using WinSCP .NET assembly

懵懂的女人 提交于 2019-12-08 02:49:39
问题 I am using WinSCP .NET assembly to do a download and upload through SFTP with C# .NET. I have the download function working but I am looking for a way to have the files in the remote server listed (or at least listed with a specific extension) so user only have to choose from those files with the specific extension (like .txt ) to get the files they want. Is there a way to do that with WinSCP .NET assembly? 回答1: Use the Session.ListDirectories method: RemoteDirectoryInfo directory = session

Get exe file into the build output directory

走远了吗. 提交于 2019-12-08 01:39:28
问题 Using WinSCP .NETassembly for SFTP support from a C# program. When building my project in Visual Studio, I would like WinSCP.exe and WinSCPnet.dll to be copied to the bin output directory. WinSCPnet.dll is easy enough - as its added as an assembly reference, just set "Copy Local" to true, and its done. But what about WinSCP.exe ? Two things I can think of: add the file WinSCP.exe to the root of the project, and set "Copy To Output Directory" to "Copy always" . in project properties Build

File transfer details binding continuously until file transfered in window using WPF

隐身守侯 提交于 2019-12-07 21:12:20
问题 I have created project to transferring file from client to server. I have done file transferred and got file transferred details such as file name (something.avi) and percentage (10%) of file transferred like below, Whenever I'm transferring a file, I'm using below event handler for knowing the file transferred details. private static void SessionFileTransferProgress(object sender, FileTransferProgressEventArgs e) { // New line for every new file if ((_lastFileName != null) && (_lastFileName

How to securely deploy PPK file in WPF C# app?

孤者浪人 提交于 2019-12-07 16:58:26
I have a C# app that connects to a SFTP server to transfer log files. The app achieves this by using WinSCP .NET assembly to connect to the server. How do I securely store the .ppk private key file such that the user is not able to take this file to access the SFTP for themselves? http://winscp.net/eng/docs/library#csharp Based on the way the library reference the .ppk , it may not be possible to avoid storing the .ppk file on the local disk during run-time? Thanks in advance. There's generally no way to hide any kind of credentials that (any) application possess from the end user. You can

A WinSCP script to download, rename, and move files

我们两清 提交于 2019-12-07 12:56:34
问题 Disclaimer #1: I posted this question on the WinSCP's forum but haven't received any replies and this issue is time-sensitive. Disclaimer #2: I'm basing the legitimacy of this cross-post on advice found on the subject from Meta. With that preamble... Up until now, I have been been using WS_FTP but would like to switch to WinSCP. I'm trying to convert this WS_FTP script into WinSCP: "C:\Program Files (x86)\Ipswitch\WS_FTP 12\wsftppro.exe" -s "sftp://USERNAME:PASSWORD@ftpus.pointclickcare.com

Enabling text file logging for WinSCP script

你离开我真会死。 提交于 2019-12-07 08:15:27
Hi have a WinSCP script to put a file on remote server using SFTP, which is working fine. But I would enable logging to a text file on a local directory. I have the following script option batch on option confirm off # connect minute session open sftp://xyz.com:22/ -privatekey=E:\PK\*.ppk # force binary mode transfer option transfer ascii # navigate to mediacom and put file lcd "E:\export\" cd /mediacom/testdir put "CI_Tst.tab" # disconnect daily session close # exit WinScP exit Many I know how I can log results of above script to a local file? To enable logging, use the /log= command-line

Include credentials of shared folder in WinSCP script file

你。 提交于 2019-12-07 07:40:25
In order to access a remote shared folder, I need to indicate the username and password. However, I have no idea where to put it in my WinSCP code. open ftps://ftpuser:password@hostname/ -explicit -certificate="key" cd Results lcd \\networkname\sharedfolder\folder\ put * This produces an error which is: Error changing directory to '...'. Any idea? Thanks Martin Prikryl The error "Error changing directory" , which you are getting is most probably caused by the lcd command . In Windows, the current working directory cannot be an UNC path (the \\networkname ). Instead of changing the current