I have a .ps1 file with my script. In this script I have a line with:
Start-Process "C:\activatebatch.bat"
If i execute it directly with ps1 file, everything works well. But if I set up a Windows Scheduler with ps1 as executive, the bat file doesn't start. In that bat file I have a WinSCP which sends file to server.
How could I set it to start .bat from .ps1 stored in Windows Scheduler? Or how could I execute WinSCP directly from PowerShell code?
I need it to call for WinSCP to send a file into server - and the options are stored in batch file:
"C:\Program Files (x86)\WinSCP\WinSCP.exe" user:password@IPI.PIP.IP.IP /command ^
"put C:\ss\file.txt /home/scripts/windows/" ^
"exit"