Link to home
Start Free TrialLog in
Avatar of Ronald Hicks
Ronald HicksFlag for United States of America

asked on

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
SOLUTION
Avatar of nurein99
nurein99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ronald Hicks

ASKER

Thanks.  It was a permissions problem on the sharename.