문제

I have been searching the web for an answer however came up with nothing. I created a VB program that calls a .bat script to call commands to run a WinSCP script. This WinSCP script simply transfer files from a sftp (linux) server to a windows machine. When running the program either via VB6 IDE or as a compiled executable the program run as normal.

However when running the program as a schedule task the program freezes and only runs until focus is brought to it. Have any encountered this error? (I'm running win 7 32bit)

There was a question similar to mine that was asked here however about VBScript and it seems the person was able to pin point the line causing the issue, not the same for me. Here is the link to the thread vbs runs by double clicking, freezes when run from task scheduler

Thanks in advance, j3rg

도움이 되었습니까?

해결책

I have found what was causing the error to occur. My project consist of a form and a module. I call the form via the module in the manner:

form.show

I forgot to set in the properties of the project to have the program start from the module Sub Main sub-routine. After selecting this option the program work as normal when called by a schedule task.

I hope this information help anyone that runs into the same scenario.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top