I have a cmd file that is executed every morning at 2:59:59 in Windows 2003 Server Task Scheduler. It runs, taking about 20 minutes to complete its tasks. If I run it manually from the command line, it runs without error. The automated run in Task Scheduler, however, finishes with an Exit Code of (1). The task list is fairly simple: I delete all files in about 12 folders on three network drives, and copy about 500 files from a production system into those same folders. The idea is to get the production system backed up to three network locations, so we always have yesterday's data available. I've entered my own Active Directory credentials in the scheduler to ''backup as'' myself (admin), and following deletion, am using the UNC convention to copy out the files, following this format: COPY CPU982ADMINADMINNEWACCTGPAYROLL*.ASC BHAM-ENG-DATASHAREGLOBALJJANSKYRBaseSandboxPAYROLL /V /Y Here is the result with the error code: ''Backup RBase.job'' (BackupRBase.cmd) Started 3/4/2009 3:00:00 AM ''Backup RBase.job'' (BackupRBase.cmd) Finished 3/4/2009 3:20:23 AM Result: The task completed with an exit code of (1). You can see, it took 20 minutes and 23 seconds to run, so it IS doing something, but the error code concerns me. I'm finding little help in a google search. I am facing a similar issue while running one of my tasks. I do not know what is wrong. Any thoughts ?
An expert who has achieved level 2 by getting 100 points
An expert that got 5 achievements.
An expert that has over 500 points.
An expert whose answer got voted for 20 times.
Re: Windows 2003 Server Task Scheduler Exit Code (1)
Return 1 does not necessarily mean that it didn't work, it just means that it ended under unusual circumstances. sometimes using a task scheduler has that effect. as long as the files end up where they are supposed to go i wouldn't worry about it.
a 6ya Technician can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repair professionals here in the US. click here to Talk to a Technician (only for users in the US for now) and get all the help you need. Goodluck!
- If you need clarification, ask it in the comment box above.
- Better answers use proper spelling and grammar.
- Provide details, support with references or personal experience.
Tell us some more! Your answer needs to include more details to help people.You can't post answers that contain an email address.Please enter a valid email address.The email address entered is already associated to an account.Login to postPlease use English characters only.
Tip: The max point reward for answering a question is 15.
2. Navigate to the key, HKLM\SOFTWARE\Microsoft\Windows NT\Current Version\Schedule. See image below.
3. The schedule key will have several subkeys located on the right side of the registry window. Single click on the Schedule key on the left of the screen, and you will then see all of the subkeys display on the right side of the window. Delete all of the subkeys on the right side of the window (ONLY), and reboot your computer.
4. Test by scheduling a task.
The Hiberfil.sys hidden system file is located in the root folder of the drive where the operating system is installed. The Windows Kernel Power Manager reserves this file when you install Microsoft Windows. The size of this file is approximately equal to the amount of random access memory (RAM) that is installed on the computer. The computer uses the Hiberfil.sys file to store a copy of the system memory on the hard disk when the hybrid sleep setting is turned on. If this file is not present, the computer cannot hibernate. Hibernation is made unavailable when you set the value of the Hibernate after setting to Never by using the Power Options item in Control Panel. To make hibernation unavailable, follow these steps: Click Start, and then type cmd in the Start Search box. In the search results list, right-click Command Prompt, and then click Run as Administrator. When you are prompted by User Account Control, click Continue. At the command prompt, type powercfg.exe /hibernate off, and then press ENTER. Type exit, and then press ENTER. To make hibernation available, follow these steps: Click Start, and then type cmd in the Start Search box. In the search results list, right-click Command Prompt, and then click Run as Administrator. When you are prompted by User Account Control, click Continue. At the command prompt, type powercfg.exe /hibernate on, and then press ENTER. Type exit, and then press ENTER to close the Command Prompt window. -------------------------------------------------------------------------------- APPLIES TO Windows Vista Business Windows Vista Enterprise Windows Vista Home Basic Windows Vista Home Premium Windows Vista Starter Windows Vista Ultimate Windows Server 2008 Datacenter without Hyper-V Windows Server 2008 Enterprise without Hyper-V Windows Server 2008 for Itanium-Based Systems Windows Server 2008 Standard without Hyper-V Windows Server 2008 Datacenter Windows Server 2008 Enterprise Windows Server 2008 Standard Windows Web Server 2008 Windows Server 2008 R2 Datacenter Windows Server 2008 R2 Enterprise Windows Server 2008 R2 Standard Windows 7 Enterprise Windows 7 Enterprise N Windows 7 Professional Windows 7 Professional N Windows 7 Ultimate Windows 7 Ultimate N http://support.microsoft.com/kb/920730
The UAC function on Windows Vista is a good idea however several applications like CCleaner and HostMan will not autostart unless you follow the instructions included in my archive file download it HERE from my SkyDrive
I have included an elevated command prompt and examples of the XML files that you can import into Task Scheduler and modify to allow the mentioned applications to run, also included is my PromptOnSecureDesktop reg tweak if needed for you system
1. Make sure that the task scheduler is enabled. If you are un-sure, go to Start/Control Panel/Administrative Tools/ Click on Services/ Then in the list of services make sure the Task Scheduler is enabled & restart the service by clicking on Start. Close the Services Folder & go back to desktop.
2. Then go to START/RUN/ and TYPE IN cmd (without the quotes) CLICK OK. This will bring up the DOS Command screen.
3. You will need to copy and paste this entry in at the flashing cursor rundll32.exe advapi32.dll,ProcessIdleTasks (without quotes) and press ENTER.
4. Now reboot three times and your Prefetch folder will be rebuilt. (It takes 3 reboots for the prefetch folder to work out what it needs)
1. create a new text file by opening notepad.
2. paste the following in the text file:
shutdown.exe -r -t 00
3. save the text file but change the .txt file extention to .bat.
4. under control panel, open task scheduler.
5. schedule a new task to run your new .bat file, whenevr the pc should be shut down.