Differences
This shows you the differences between the selected revisions of the page.
2014-10-20 | 2014-10-20 | ||
it's about remote files only (martin) | extending to a local file existence (martin) | ||
Line 373: | Line 373: | ||
===== [[checking_file_existence]] Checking remote file existence ===== | ===== [[checking_file_existence]] Checking remote file existence ===== | ||
- | ==== Using WinSCP .NET Assembly ==== | + | ==== [[remote]] Remote file existence ==== |
+ | |||
+ | === Using WinSCP .NET Assembly === | ||
Use method ''[[library_session_fileexists|Session.FileExists]]'' from [[library|WinSCP .NET assembly]]. | Use method ''[[library_session_fileexists|Session.FileExists]]'' from [[library|WinSCP .NET assembly]]. | ||
Line 391: | Line 393: | ||
~~AD~~ | ~~AD~~ | ||
- | ==== [[scripting]] Using WinSCP Scripting and XML Logging from JScript ==== | + | === [[scripting]] Using WinSCP Scripting and XML Logging from JScript === |
You may use following [[guide_automation_advanced#wsh|Windows script host JScript code]] (''example.js''): | You may use following [[guide_automation_advanced#wsh|Windows script host JScript code]] (''example.js''): | ||
Line 488: | Line 490: | ||
Alternatively you can continue with the processing directly in JScript code as suggested by respective comments. | Alternatively you can continue with the processing directly in JScript code as suggested by respective comments. | ||
+ | |||
+ | ==== [[local]] Local file existence ==== | ||
+ | |||
+ | * In [[library_powershell|PowerShell]], use ''[[http://technet.microsoft.com/en-us/library/hh849776.aspx|Test-Path]]'' cmdlet. See [[library_session_getfiles#powershell|example]]. | ||
+ | * In batch file, use ''[[http://technet.microsoft.com/en-us/library/cc754335.aspx|if]]'' command. See [[guide_automation_conditional#scripting|example]]. | ||
+ | * In .NET, use ''[[http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx|File.Exists]]'' method. See [[library_session_getfiles#csharp|C#]] and [[library_session_getfiles#vbnet|VB.NET]] example. | ||
+ | * In WSH, use ''[[http://msdn.microsoft.com/en-us/library/x23stk5t.aspx|Scripting.FileSystemObject.FileExists]]'' method. See [[library_session_getfiles#jscript|JScript]] and [[library_session_getfiles#jscript|VBScript]] example. | ||
===== [[local_move_after_successful_upload]] Moving local files to different location after successful upload ===== | ===== [[local_move_after_successful_upload]] Moving local files to different location after successful upload ===== |