Windows Task Scheduler

I have a script (batch file .bat) that copies files from the local server to an FTP location.  The script works fine when run from a command prompt, but fails (0x1) while using Windows Task Scheduler.  The only way it works is if I select 'Run only when user is logged on'.  I need this script to run daily whether the user account is logged on or not.  I'm using Server 2008 Std
emeka57Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pradeep DubeyConsultantCommented:
Have you tried to run schedule task when you are logged in?

In 2k8 there is a problem with the quotes and for that they have released a hot fix (link is given below).
http://support.microsoft.com/kb/951246

check below discussion:

http://social.technet.microsoft.com/Forums/windowsserver/en-US/d47d116e-10b9-44f0-9a30-7406c86c2fbe/scheduled-task-wont-run-bat-file?forum=winservermanager
0
emeka57Author Commented:
The task works fine if I select to 'run only when user is logged on', but doesn't work any other way.
0
Pradeep DubeyConsultantCommented:
and what happened when user is locked the session at that point also its working fine ?
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

AlexPaceCommented:
Mapped drives don't work when there is no user logged in... could that be the problem?
0
emeka57Author Commented:
No, it's a script to copy one file from a local drive to an FTP location.
0
emeka57Author Commented:
The script runs fine when the server is locked.
0
AlexPaceCommented:
Did you try running the task as administrator?
0
emeka57Author Commented:
I did. My account is a domain admin and part of the local admin group.
0
AlexPaceCommented:
I've used a scheduled task to run Robo-FTP when nobody is logged into the computer.  You can also set it up to run as a Windows Service which definitely doesn't require a user session.  Maybe try that... the scripting syntax is similar in some ways to batch files so you should be able to convert it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Wireless Networking

From novice to tech pro — start learning today.