Differences
This shows you the differences between the selected revisions of the page.
2020-03-03 | 2020-03-03 | ||
using compound statement (martin) | Testing File Access Permissions (martin) | ||
Line 47: | Line 47: | ||
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="c:\script\example.txt" /log="c:\script\example.log" | "C:\Program Files (x86)\WinSCP\WinSCP.com" /script="c:\script\example.txt" /log="c:\script\example.log" | ||
echo WinSCP done | echo WinSCP done | ||
- | ) > C:\script\example.out | + | ) > C:\script\example.out 2>&1 |
</code> | </code> | ||
Make sure you use a path for the ''example.out'', where Windows Scheduler/%%SSIS%% have a write access to. Check an output logged to ''example.out'' for any problems. If the ''example.out'' is not even created, the problem is not with WinSCP. | Make sure you use a path for the ''example.out'', where Windows Scheduler/%%SSIS%% have a write access to. Check an output logged to ''example.out'' for any problems. If the ''example.out'' is not even created, the problem is not with WinSCP. | ||
+ | |||
+ | ===== [[file_access]] Testing File Access Permissions ===== | ||
+ | If it turns out that WinSCP cannot read or write local files, it is usually because the local account that runs the Windows Scheduler/%%SSIS%% does not have permissions to access those files or their containing folders. Try reading or writing those files in a wrapper batch file (see the previous section), to verify that you get the same problem even without WinSCP. | ||
+ | |||
+ | <code batch> | ||
+ | @echo off | ||
+ | ( | ||
+ | echo Testing reading of a file | ||
+ | copy C:\source\file.txt %TEMP% | ||
+ | |||
+ | echo Testing writing of a file | ||
+ | echo Dummy contents > C:\destination\file.txt | ||
+ | |||
+ | echo Starting WinSCP | ||
+ | "C:\Program Files (x86)\WinSCP\WinSCP.com" /script="c:\script\example.txt" /log="c:\script\example.log" | ||
+ | echo WinSCP done | ||
+ | ) > C:\script\example.out 2>&1 | ||
+ | </code> | ||
===== Further Reading ===== | ===== Further Reading ===== |