Running SmartFTP as a Scheduled Task

I am currently evaluating SmartFTP for use at a client and I need to be able to run the program in the background whether or not anyone is logged in. I came across this article explaining how to run the program using the Task Scheduler, but I'm having a few problems getting it to work.

I created the scheduled task exactly as explained in the article setting it to trigger every 5 minutes. In SmartFTP, I have a task set up to move the files from the server to the local machine every minute and close once the transfer has completed. This all works fine when I run it manually (by opening SmartFTP and leaving it run, the tasks execute and then the program closes). When the Windows scheduled task runs, the application briefly shows up in the task manager and then disappears. None of the files are transferred and the program just appears to crash.

Am I doing something wrong in setting this up? Please let me know if I can provide more information that would help in solving this.

Thanks!

Please post the system information from the menu: Help->About "System Information" dialog.

As requested:

+- System -----------------------------

Microsoft Windows 2008 R2 Server Standard Edition (full installation) 

Service Pack 1 (Build 7601)



CPU Speed           : 2398 MHz

Total Memory        : 2047 MB

Free Memory         :  872 MB



+- SmartFTP ---------------------------

Version             : 4.0.1194.0

Time Stamp          : 2011-06-17 20:25:37

Platform            : x64

Unlicensed

Days in use         : 0



+- Language ---------------------------

en-US



+- Internet Explorer ------------------

Version             : 8.0.7601.17514

Install this version:
https://www.smartftp.com/get/SFTPMSI64.exe

Did you start/configure SmartFTP for the user under which the task is running?
When you do that, close all the browsers before you close SmartFTP (menu: Window->Close All).

I downloaded the latest build (1199), but I'm now receiving the trial dialog when the program starts, so the scheduled task can't complete (as in this article). Is it possible to get a temporary license? I have nearly the full amount of time left on the trial still.

Is there any way for me to test the scheduling with the trial? This is a critical feature for our client.

Scheduling is fully working in the trial. But if you would like to run it as an unattended task you need to purchase a license.


Scheduling is fully working in the trial. But if you would like to run it as an unattended task you need to purchase a license.

Based on my testing, SmartFTP does not appear to run properly when scheduled. I set up a scheduled task as mentioned above and when the task runs, SmartFTP shows up in Task Manager briefly (for a few seconds at most) before disappearing. It never actually opens for the user to interact with it.

SmartFTP displays a license reminder dialog during the trial. If you run it unattended this dialog will not be displayed on the screen and therefore SmartFTP is stuck until the OK button is clicked in the dialog.


SmartFTP displays a license reminder dialog during the trial. If you run it unattended this dialog will not be displayed on the screen and therefore SmartFTP is stuck until the OK button is clicked in the dialog.

I understand that. When I first downloaded the trial, I was not receiving the license reminder, so in theory the scheduled task should have worked. However, when the task ran, SmartFTP.exe would appear in the task manager and then disappear. Later on, the license reminder dialog started to show up.

When I initially looked at the task manager, the executable didn't show up. On further investigation, I found that when the task ran, SmartFTP.exe would show up and then disappear a few seconds later. If the scheduled task was stuck at the license reminder dialog, I would expect the executable to persist in the task manager.

I recommend that you purchase a license (a single user license is okay) and we will be able to provide technical support.


I recommend that you purchase a license (a single user license is okay) and we will be able to provide technical support.

Ok I've purchased a license. Is there anything else I need to do?

Thank you. Please post the system information from the menu: help->About "System Information" dialog.

As requested:

+- System -----------------------------

Microsoft Windows 7  

Service Pack 1 (Build 7601)



CPU Speed           : 2667 MHz

Total Memory        : 4095 MB

Free Memory         :  991 MB



+- SmartFTP ---------------------------

Version             : 4.0.1202.0

Time Stamp          : 2011-06-30 12:45:22

Platform            : x64

Id                  : 400139396

Maintenance         : 2012-07-06

Days in use         : 15



+- Language ---------------------------

en-US



+- Internet Explorer ------------------

Version             : 9.0.8112.16421

Please install the latest version: https://www.smartftp.com/download/

Then close all remote browsers in SmartFTP: menu: Window->Close All

Close SmartFTP and run it through the Task Scheduler. Enable debug logging as described here:
https://www.smartftp.com/support/kb/how- ... f2613.html

This will create a log file (SmartFTP<processid>.log) each time SmartFTP is started. The log also contains further information that will tell you when the process exited and why.

I installed the latest version yesterday and did a bit of testing this morning. I found that everything runs fine if I open SmartFTP manually (as before). Here is the log file from that process:

20110707 08:21:23.131 Thread(2556) Log file opened. LogLevel=7

20110707 08:21:23.131 Thread(2556) Microsoft Windows 6.1.7601 Service Pack 1

20110707 08:21:23.131 Thread(2556) SmartFTP 4.0.1204.0 (2011-07-04 18:01:14)

20110707 08:21:23.131 Thread(2556) Username: lisag)

20110707 08:21:23.131 Thread(2556) Winsock 2.2 initialized

20110707 08:21:23.131 Thread(2556) GlobalSettings::Fix()

20110707 08:21:23.131 Thread(2556) Init sfFTPLib::Global

20110707 08:21:23.147 Thread(2556) Init sfTransferQueue::TransferQueueGlobal

20110707 08:21:23.162 Thread(2556) Init sfFTPLib::UPnPNATManager

20110707 08:21:23.162 Thread(2556) Failed to initialize sfFTPLib::UPnPNATManager.

20110707 08:21:23.162 Thread(2556) CLicenseKey::LoadFile(C:\Users\lisag\AppData\Roaming\SmartFTP\Client 2.0\SmartFTP.key)

20110707 08:21:23.162 Thread(2556) CLicenseKey::LoadXML()

20110707 08:21:23.162 Thread(2556) CLicenseKey::Verify()

20110707 08:21:23.162 Thread(2556) CLicenseKey::Verify() Verified.

20110707 08:21:23.162 Thread(2556) Init XTP.

20110707 08:21:23.240 Thread(2556) Init QuickFolders.

20110707 08:21:23.240 Thread(2556) Init FavoritesManager.

20110707 08:21:23.256 Thread(2556) Init sfFavoritesShellExtension::Global

20110707 08:21:23.271 Thread(2556) Init sfFavoritesUI::Global

20110707 08:21:23.271 Thread(2556) Init TransferQueueManager.

20110707 08:21:23.271 Thread(2556) Init TransferStatistics.

20110707 08:21:23.271 Thread(2556) Init SchedulerManager.

20110707 08:21:23.318 Thread(2556) CMainFrame::OnCreate() hwnd=0000000000110382

20110707 08:21:23.833 Thread(2556) CMainFrame::InitClipboardViewer() SetClipboardViewer() returned 0000000000000000

20110707 08:25:42.657 Thread(2556) CMainFrame::OnDestroy()

20110707 08:25:42.657 Thread(2556) CSmartFTPApp::ExitInstance()

20110707 08:25:43.047 Thread(2556) Log file closed.

Everything works as expected with the file transfers.

Now when the scheduled task runs, I can't find SmartFTP.exe in the task manager. In Task Scheduler, the status is running and it never terminates.

Here's a screenshot of the history from the Task Scheduler

The only messages I receive other than those are that the task cannot be started because it is already running (as expected). I double checked the setup of the task and it follows the format listed in one of the articles here (referred to in the first post). Is there something else I need to configure? I have SmartFTP set up to close after all transfers are completed.

And what does the .log say?


And what does the .log say?

There is no log generated for the scheduled task because SmartFTP doesn't appear to be executing (the executable doesn't show up in Task Manager at all). The task in the scheduler is shown as running, but I don't see the SmartFTP process.

Ensure that you the credentials you are using for the scheduled task are correct.


Ensure that you the credentials you are using for the scheduled task are correct.

The task is running under the same account as when it is run manually. In neither case is it run as administrator. Should the task be running as administrator?

No, it doesn't need to run as administrator. The first thing SmartFTP does when it is started is create the .log file (when the setting is enabled in the registry). You are saying no .log is created which seems that for whatever reason the .exe is not started at all.


No, it doesn't need to run as administrator.

Ok.


The first thing SmartFTP does when it is started is create the .log file (when the setting is enabled in the registry). You are saying no .log is created which seems that for whatever reason the .exe is not started at all.

This is exactly it. I've watched the Task Manager when the task should start, but SmartFTP.exe doesn't show up at all. Once the task starts, it remains in the 'Running' state indefinitely and never terminates.

If SmartFTP starts, you would have a log.

I recreated the task and let it run as scheduled and got a log this time:

20110708 13:00:02.190 Thread(4836) Log file opened. LogLevel=7

20110708 13:00:02.190 Thread(4836) Microsoft Windows 6.1.7601 Service Pack 1

20110708 13:00:02.190 Thread(4836) SmartFTP 4.0.1204.0 (2011-07-04 18:01:14)

20110708 13:00:02.190 Thread(4836) Username: lisag)

20110708 13:00:02.191 Thread(4836) Winsock 2.2 initialized

20110708 13:00:02.191 Thread(4836) GlobalSettings::Fix()

20110708 13:00:02.192 Thread(4836) Init sfFTPLib::Global

20110708 13:00:02.253 Thread(4836) Init sfTransferQueue::TransferQueueGlobal

20110708 13:00:02.272 Thread(4836) Init sfFTPLib::UPnPNATManager

20110708 13:00:02.274 Thread(4836) Failed to initialize sfFTPLib::UPnPNATManager.

20110708 13:00:02.274 Thread(4836) CLicenseKey::LoadFile(C:\Users\lisag\AppData\Roaming\SmartFTP\Client 2.0\SmartFTP.key)

20110708 13:00:02.274 Thread(4836) CLicenseKey::LoadXML()

20110708 13:00:02.276 Thread(4836) CLicenseKey::Verify()

20110708 13:00:02.276 Thread(4836) CLicenseKey::Verify() Verified.

20110708 13:00:02.276 Thread(4836) Init XTP.

20110708 13:00:02.338 Thread(4836) Init QuickFolders.

20110708 13:00:02.338 Thread(4836) Init FavoritesManager.

20110708 13:00:02.392 Thread(4836) Init sfFavoritesShellExtension::Global

20110708 13:00:02.394 Thread(4836) Init sfFavoritesUI::Global

20110708 13:00:02.401 Thread(4836) Init TransferQueueManager.

20110708 13:00:02.404 Thread(4836) Init TransferStatistics.

20110708 13:00:02.404 Thread(4836) Init SchedulerManager.

20110708 13:00:02.432 Thread(4836) CMainFrame::OnCreate() hwnd=00000000000A02C6

20110708 13:00:03.960 Thread(4836) CMainFrame::InitClipboardViewer() SetClipboardViewer() returned 0000000000000000

20110708 13:00:04.130 Thread(4836) Exception: CException Code: 0x80004005 in 'ShellBrowserImpl.h' Line: 1093

20110708 13:00:04.370 Thread(4836) Exception: CException Code: 0x80004005 in 'ShellBrowserImpl.h' Line: 1093


The task still runs indefinitely and the files do not get transferred. Does the exception mean I have set something up incorrectly?

To avoid the exceptions close all the browsers in SmartFTP: menu: Window->Close All.

What do you see in the sfTransferQueue*.log?

I made sure all of the windows were closed using the 'Close All' and the exception is still around. Here are the two log files:

SmartFTP*.log
20110708 14:40:00.174 Thread(7004) Log file opened. LogLevel=7

20110708 14:40:00.174 Thread(7004) Microsoft Windows 6.1.7601 Service Pack 1

20110708 14:40:00.174 Thread(7004) SmartFTP 4.0.1204.0 (2011-07-04 18:01:14)

20110708 14:40:00.175 Thread(7004) Username: lisag)

20110708 14:40:00.176 Thread(7004) Winsock 2.2 initialized

20110708 14:40:00.176 Thread(7004) GlobalSettings::Fix()

20110708 14:40:00.176 Thread(7004) Init sfFTPLib::Global

20110708 14:40:00.182 Thread(7004) Init sfTransferQueue::TransferQueueGlobal

20110708 14:40:00.186 Thread(7004) Init sfFTPLib::UPnPNATManager

20110708 14:40:00.187 Thread(7004) Failed to initialize sfFTPLib::UPnPNATManager.

20110708 14:40:00.188 Thread(7004) CLicenseKey::LoadFile(C:\Users\lisag\AppData\Roaming\SmartFTP\Client 2.0\SmartFTP.key)

20110708 14:40:00.188 Thread(7004) CLicenseKey::LoadXML()

20110708 14:40:00.191 Thread(7004) CLicenseKey::Verify()

20110708 14:40:00.191 Thread(7004) CLicenseKey::Verify() Verified.

20110708 14:40:00.191 Thread(7004) Init XTP.

20110708 14:40:00.258 Thread(7004) Init QuickFolders.

20110708 14:40:00.259 Thread(7004) Init FavoritesManager.

20110708 14:40:00.287 Thread(7004) Init sfFavoritesShellExtension::Global

20110708 14:40:00.288 Thread(7004) Init sfFavoritesUI::Global

20110708 14:40:00.297 Thread(7004) Init TransferQueueManager.

20110708 14:40:00.300 Thread(7004) Init TransferStatistics.

20110708 14:40:00.300 Thread(7004) Init SchedulerManager.

20110708 14:40:00.346 Thread(7004) CMainFrame::OnCreate() hwnd=00000000000D02C6

20110708 14:40:01.195 Thread(7004) CMainFrame::InitClipboardViewer() SetClipboardViewer() returned 0000000000000000

20110708 14:40:01.285 Thread(7004) Exception: CException Code: 0x80004005 in 'ShellBrowserImpl.h' Line: 1093

20110708 14:40:01.605 Thread(7004) Exception: CException Code: 0x80004005 in 'ShellBrowserImpl.h' Line: 1093


sfTransferQueue*.log
20110708 14:40:00.185 Thread(7004) Log file opened. LogLevel=7

20110708 14:40:00.297 Thread(7004) CTransferQueue::Init()

20110708 14:40:00.327 Thread(7004) CTransferQueue::Load(C:\Users\lisag\AppData\Roaming\SmartFTP\Client 2.0\Transfer Queue.xml)

20110708 14:40:00.332 Thread(7004) CTransferQueue::Start()

20110708 14:40:00.332 Thread(2708) CTransferQueue::OnCommandStart()


The task still runs indefinitely and the content of the files is from when the task is still running.

You should see no exceptions when no windows get restored. This is the case if you close all Windows before SmartFTP is closed. Kill all instances of SmartFTP first. Then start SmartFTP and close all windows. Exit SmartFTP. Start SmartFTP again. If any of the windows get restored something is not right.

What kind of schedules did you setup? Because according to the log the transfer queue is running and I assume the scheduler as well.

I think I've managed to get it working. It turns out I disabled the scheduled tasks in SmartFTP (nothing was running) and turned off the auto-close (the application was still running indefinitely after I enabled the scheduled tasks) when I was working on fixing something else and forgot to turn them back. Duh!

Thanks for all of your help!

I am running into a similar problem, yet I am using the SmartFTP Library Object in an automated VB 6 app. I have installed SmartFTP client with a valid license. I have a similar problem. If I am signed on to the computer and the scheduled task runs, the files are ftp'd properly. When I am logged off the machine in question, when the scheduled task runs, the ftp upload does not work, returning an error of "Object ~ of method ~ failed."

Closing this thread.

>Rob
Start a new thread and describe your problem in details.