PhIsH3r All American 879 Posts user info edit post |
Problem: when trying to update a file using '>>' I receive "Access Denied." I can create files using '>' or '>>'. For example:
x:\echo hello > test.txt ; successful completion x:\echo hi >> test.txt ;fails ACCESS DENIED x:\
I can update files using edit. Meaning I can open a file with edit make changes, and save changes.
Setup server Windows 2000 advanced server. Dos image win98 dos with networking support. Modified version of this image http://www.nu2.nu/bootdisk/network/
I'm booting the diskless client using PXE, and loading the DOS image. I'm using TCP/IP and file sharing. I have full control access granted on the server to the files/folders I want to be able to change.
Has anyone done anything like this before? Anyone know how i can fix this? 2/16/2006 10:53:08 AM |
mellocj All American 1872 Posts user info edit post |
Not sure if this will help.. but I used to write files in DOS using copy con back when I used bootdisks to load windows 95 over a network:
see this link http://www.computerhope.com/issues/ch000398.htm 2/16/2006 11:30:42 AM |
eraser All American 6733 Posts user info edit post |
Hmm.
Usually that will happen if the file is open at the time.
Creating the file the appending it on the next line in the script could be 'too ambitious' in some cases. Batch files do not wait for the previous line to complete before they go on to the next unless there is an intentional break. It is quite possible that the file is not yet closed from the previous operation.
See if this works:
echo Make a new file > test.txt pause echo Add a line > test.txt
Alternatively, you could be better off redesigning how you get the output:
FILENAME: OPERATION.BAT
@echo off echo This statement will really go into a file later. echo Some other stuff
; *other code here*
:exit
BUT, don't run OPERATION.BAT, make another file:
FILENAME: LOG.BAT
@echo off if not exist %1 goto fail
%1 > test.txt goto exit
:fail echo Cannot find script! :exit
Run: LOG OPERATION.BAT That way, you don't have to worry about appending the file, you can just run a single .BAT or .CMD file that captures all of the output automatically.
[Edited on February 16, 2006 at 12:01 PM. Reason : more code]2/16/2006 11:43:31 AM |
PhIsH3r All American 879 Posts user info edit post |
eraser That's a good idea, I'll give it a try and see what happens.
on a related note, on a windows XP machine connected to the same server i can use the command prompt and the append arrows (>> ) to append files on the server with no problem.
This is making me think it might be an issue with my particular dos image.
[Edited on February 16, 2006 at 2:11 PM. Reason : .] 2/16/2006 2:00:14 PM |
eraser All American 6733 Posts user info edit post |
Since you are using _DOS_ instead of the NT Command Interpreter you could be running into a sharing violation. Such an event would cause an "access denied." If you have space on the disk, try to find a compatible version of the "SHARE.EXE" tool and add it to AUTOEXEC.BAT wit the proper parameters. 2/16/2006 2:13:11 PM |