Task Scheduler in Windows 2008 Server Standard

What's the general trick to get the same command you can successfully use Run with in a Scheduled Task in 2008?  I didn't have problems on a 2003 Server.

I've got two Scheduled Tasks that run fine from a Run window and a Shortcut but they immediately stop and produce Return Codes as Scheduled Tasks:

The first one is a relatively simple batch file -
   "\\server\share\folder\folder\file.cmd"
produces a Return Code of 9009.  The CMD file was selected using the Browse button in the Add Action window.

The second runs a local program with several parameters -
   "C:\Program Files (x86)\vendor\program.exe" -x "\\server\share\folder\folder\parameter.file"
produces Return Code 143.  2008 moves the parameters into the Add Arguments box automatically.

Thanks in advance!
Wade_ChestnutAsked:
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.

JHallidayChief Technical OfficerCommented:
Are you specifying a username name to run the tasks as ?

(See highlighted area in the image)
EE-25504151.jpg
0
Wade_ChestnutAuthor Commented:
Not at first because I'm troubleshooting the problem now.  I will eventually want the task to run with the user logged off.  I'm just running them manually to help simplify the problem.
I did take the first one and put it into a CMD file and that worked for some reason.  I'm still troubleshooting the second one.
0
JHallidayChief Technical OfficerCommented:
Can you send me a snapshot of your scheduled task window ?
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

JHallidayChief Technical OfficerCommented:
It may need to run in elevated permissions (Run with Highest Privileges checkbox at the bottom)
0
Wade_ChestnutAuthor Commented:
I finally got it to work!  Even though I could execute the single command in a CMD file (and it worked in 2003), I had to add a NET USE to a network drive, select that drive letter, then Change Directory to where the parameter file resided.  That makes no sense to me but at least it works.  Thanks for the suggestions!
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
JHallidayChief Technical OfficerCommented:
Ah actually that makes perfect sense.  When you run an application in Task Scheduler its almost like logging on as a new user (even though you may be already logged in) the problem is it doesn't run any log in script or map any drives you may have cached etc so if you are accessing files on a network drive you either have to use an absolute path (i.e. \\server\share\directory\file) or have a line that maps the drive in the CMD file.  Glad you got it sorted :)
0
Wade_ChestnutAuthor Commented:
JHalliday, I was actually using the UNC path to the network share, but it didn't like that for some reason.  I copied the exact command line (with the UNC path) from the 2003 Scheduled Task into the 2008 Task and it didn't work.  I tried looking for a "proper" way to create new Actions in 2008 thinking they changed something and I was doing something wrong but I couldn't find anything.  Oh well.  At least it does work now.  Thanks for replying.
0
JHallidayChief Technical OfficerCommented:
Was your CMD file using a network path of some description ?
0
Wade_ChestnutAuthor Commented:
"...of some description?" -- not sure what you mean by that.  
It was using the same UNC path as the previous Windows 2003 Server directly pointing to the folder on the NAS, and I even added the same UNC path to the "Start in (optional) field.
0
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
Windows Server 2008

From novice to tech pro — start learning today.