Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XCOPY and AT

Posted on 2006-11-28
3
Medium Priority
?
742 Views
Last Modified: 2008-02-01
Howdy.

I'm using XCOPY in a batch file and AT to schedule nightly backups on a Win2k3 Storage Server.  I'm having a problem and am seeing the following stuff in the log:

"At2.job" (Tuesday.bat)
      Finished 11/28/2006 2:15:00 AM
      Result: The task completed with an exit code of (1).

I also see an exit code of (4)


I know these error codes are less than informative.  Does anyone have any idea what might be happening?  I've done this on other Win2k server machines without error.

If not - how bout a cheap/free alternative to AT or it's GUI equivalent.

TIA
0
Comment
Question by:ttist25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 18035361
The task scheduler can't do miracles; the at command just starts the script, it doesn't know what the script does. You have to log what you're doing in the batch file to find out what's not working there.
You can create the log file by redirecting the command output. The output redirection for the xcopy command in the following example, '>>"%LogFile%" 2>&1', will redirect the standard output (>>"%LogFile%") as well as the standard error output (2>&1 redirects stderr to stdout) to the logfile.

@echo off
setlocal
set LogFile=C:\Temp\scheduled-task.log
if exist "%LogFile%" del "%LogFile%"
>>"%LogFile%" echo Task started: %Date% %Time%
xcopy ... >>"%LogFile%" 2>&1
>>"%LogFile%" echo Task ended: %Date% %Time%
0
 
LVL 10

Expert Comment

by:Seelan Naidoo
ID: 18039367
have a look a robocopy.exe, as it was designed for Windows 2003 as an improvment to xcopy..

Its part of the 2003 Res Kit

Download it here:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=9D467A69-57FF-4AE7-96EE-B18C4790CFFD
0
 
LVL 1

Author Comment

by:ttist25
ID: 18115300
Sorry for taking so long to get back on this.  It's certainly been a crazy few weeks.  

Anyway - the LogFile thing worked exceptionally well.  I was able to see that I'm getting an invalid drive specification error.  Drives are mapped via Group Policy which occurs at login.  I'm assuming that since I am not logged in when the batch file runs this is the reason for the error.

Today I'll do a "manual" mapping of these drives and see if that takes care of it.

Again - excellent advice.  It worked like a charm.

THANKS!  
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question