Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Np. Though you should not put your own files into Windows system folders.
shaddad

You sir, are the man. This made a lot of sense after reading. I put the DLL, exe, and script inside the System32 folder, added powershell.exe / -File "File name" and it ran beautifully from the Task Scheduler. I was a little too deep and step back to think about this. Thank you!!
martin

Re: .NET assembly via Task Scheduler

This is not really a WinSCP question.
You are trying to run a PowerShell script.
A PowerShell script is executed either using powershell (PowerShell 5 and older) or pwsh (PowerShell 6 and newer) commands. No winscp.exe is involved.
See https://winscp.net/eng/docs/library_powershell#scripting
shaddad

.NET assembly via Task Scheduler

I have a quick question, I have a working PS1 with .NET assembly that runs just fine when I run it inside the WinSCP Automation folder but does not run in the Task scheduler, I've been trying all the different ways in the forums to run it with no luck, here are some of the attempts:

Attempt1:
"C:\Program Files (x86)\WinSCP\WinSCP.com"
/script="C:\Users\gp-mradmin\Desktop\WinSCP-6.1.2-Automation\TTSI_SFTP_1.ps1"

Attempt2:
C:\Users\gp-mradmin\Desktop\WinSCP-6.1.2-Automation\TTSI_SFTP_1.ps1

Attempt3:
"C:\Users\gp-mradmin\Desktop\WinSCP-6.1.2-Automation\WinSCP.exe"
/script="C:\Users\gp-mradmin\Desktop\WinSCP-6.1.2-Automation\TTSI_SFTP_1.ps1"

All failing with the same error code:
2147942401

Could you please help me with the Program/Script and Arguments for this please?

Location Variable: C:\Users\gp-mradmin\Desktop\WinSCP-6.1.2-Automation
PS: TTSI_SFTP_1.ps1