access denied writing to txt file

I'm having a problem porting a batch file, backup.bat, that backs up some files.  It runs fine on my NT4 machines but bombs out on every line when run on my new 2k3 server.  Even the first lines, which only record the date and time of the run by appending them to a text file, get 'access denied'.  Solving this problem on these two lines might take care of the same problem on the rest of the script.  Here's what the first two lines look like.

date >> \\saec2\backuplogs\totaltime.txt
date /t >> \\saec2\backuplogs\totaltime.txt

"SAEC2" is name of a 2K3 server, and I'm running backup.bat by double clicking its name in explorer.
(When I get it to work, I'll schedule it to run automatically.)

"backuplogs" is a share name and a folder name on SAEC2.

I'm logged on to SAEC2 with a doman admin account.

The share and the file have read privileges for Users but Full Control for admins.

When backup.bat ran to completion in the blink of an eye, I put a Pause after the first line and observed the Access Denied.

(Of course, the next mod which copies files from workstations to servers on Domain1 and from servers on Domain1 to SAEC2 on Domain2

I'm able to see all the servers and machines on both domains from any machine on either and am able to move files by dragging and dropping from one domain to the other with no problem.  But even if there were issues with cross domain access, this little line that just appends a date to a text file should run.  What am I doing wrong, or, what's new in 2K3 that I  need to do differently for this to work?

Why would something so straightforward as appending to a text file on the same machine where I'm running the program that takes that action get an "access denied"?

Do I somehow have to tell something (what?  how?) to run backup.bat with admin privileges?

Many thanks, Ron Hicks, St. Alban's Church, Washington DC
Ronald HicksConsultantAsked:
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.

Make sure the Share permission of \backuplogs\ directory is also full Control for System Admins and also try puting Domain Admins in to the Local  Administrators group of the local  Machine.  Hope this help.

open a command prompt and type:

net use q: \\saec2\backuplogs

and see if that completes successfully.  If it does, then you have mapped the drive q to the \\saec2\backuplogs\  folder

If id doesn't work, then you don't personally have access to that share (or better yet, is \\saec2\backuplogs really a share?).  You could try running this as a different user (right click on your bat file, and select "run as")  this also applies to running this as a scheduled task.

I would say this is a permissions problem.  If you are going to run this daily, as a backup script, I would suggest that you do not run this as an admin.  You should create a new user called something like "companyname-backup" and set the password to never expire.  then give this user the minimal rights to the files you want to backup, and full access to the place you are storing the backups.  You'll then run your bat file as this user.

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
Ronald HicksConsultantAuthor Commented:
Thanks.  It was a permissions problem on the sharename.  
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 2003

From novice to tech pro — start learning today.