Differences
This shows you the differences between the selected revisions of the page.
2017-02-02 | 2017-02-09 | ||
library_examples explicit anchor (martin) | first argument of start is title (martin) | ||
Line 18: | Line 18: | ||
* The application run as a custom command (be it the ''powershell.exe'' or WinSCP in a console mode) is executed in WinSCP startup directory, not in a WinSCP [[executable]] directory, nor directory shown in a local panel (in [[ui_commander|Commander interface]]). \\ So generally, you should use a full path to local files, both in the custom command itself (particularly for a path to WinSCP executable and path to the script) and the script (including a [[library_powershell#loading|path to WinSCP .NET assembly]]). \\ You can make use of ''[[local_path|%WINSCP_PATH%]]'' to refer to the WinSCP executable path. | * The application run as a custom command (be it the ''powershell.exe'' or WinSCP in a console mode) is executed in WinSCP startup directory, not in a WinSCP [[executable]] directory, nor directory shown in a local panel (in [[ui_commander|Commander interface]]). \\ So generally, you should use a full path to local files, both in the custom command itself (particularly for a path to WinSCP executable and path to the script) and the script (including a [[library_powershell#loading|path to WinSCP .NET assembly]]). \\ You can make use of ''[[local_path|%WINSCP_PATH%]]'' to refer to the WinSCP executable path. | ||
* If the custom command refers to files (i.e. uses [[custom_command#patterns|patterns]] like ''!'', ''!&'', ''!^!''), WinSCP window is blocked, while the command is running. Should you want to avoid that, use the ''start'' command. Though note this prevents WinSCP from uploading files back to the server, if they were modified by the command. \\ <code batch> | * If the custom command refers to files (i.e. uses [[custom_command#patterns|patterns]] like ''!'', ''!&'', ''!^!''), WinSCP window is blocked, while the command is running. Should you want to avoid that, use the ''start'' command. Though note this prevents WinSCP from uploading files back to the server, if they were modified by the command. \\ <code batch> | ||
- | cmd.exe /c start powershell.exe -File c:\example\example.ps1 | + | cmd.exe /c start "" powershell.exe -File c:\example\example.ps1 |
</code> | </code> | ||
* If the command modifies a remote directory, you can run WinSCP with the ''[[commandline#operations|/refresh]]'' parameter at the end of the (PowerShell) script to have the remote panel reloaded. \\ <code powershell> | * If the command modifies a remote directory, you can run WinSCP with the ''[[commandline#operations|/refresh]]'' parameter at the end of the (PowerShell) script to have the remote panel reloaded. \\ <code powershell> |