Computing.Net > Forums > Programming > Windows 2000 >> Batch file Problem

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Windows 2000 >> Batch file Problem

Reply to Message Icon

Original Message
Name: RickSw
Date: August 10, 2005 at 11:33:59 Pacific
Subject: Windows 2000 >> Batch file Problem
OS: Windows 2000
CPU/Ram: PIIII/256
Comment:

I have a simple batch file that uses the >> append output redictor. In Windows 2000 the batch file is acting as if I entered > and overwritting this output file. The simple form of the file is:

echo %computername%,%username% >> q:\usage.txt

Window 95/98/XP all seem to work fine and append the file. What's up with Windows 2000?


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: August 10, 2005 at 12:17:47 Pacific
Reply: (edit)

It works OK on my w2k.

M2


If at first you don't succeed, you're about average.


Report Offensive Follow Up For Removal

Response Number 2
Name: RickSw
Date: August 10, 2005 at 13:14:58 Pacific
Reply: (edit)

I have SP4 with all the latest patches. Do you have the same?


Report Offensive Follow Up For Removal

Response Number 3
Name: Mechanix2Go
Date: August 10, 2005 at 13:57:04 Pacific
Reply: (edit)

I've got SP3 and no patches.

I doubt it's a SP issue.

The >> append has been stable in DOS and NT for a very long time. I can think of no reason / scenario which might prompt a change.

You could try a fresh copy of CMD.exe, but that sems far-fetched.

M2


If at first you don't succeed, you're about average.


Report Offensive Follow Up For Removal

Response Number 4
Name: RickSw
Date: August 10, 2005 at 14:09:49 Pacific
Reply: (edit)

New Info.
I only fails / malfunctions over the network. If I redirect the file to the c:\ drive it work fine.


Report Offensive Follow Up For Removal

Response Number 5
Name: RickSw
Date: August 10, 2005 at 14:38:40 Pacific
Reply: (edit)

More new Info...
It seems to be a permissions problem. Giving "Everyone" full control fixed it. (Bad idea to leave it this way). So, I retraced the permissions and found that if the advanced special permission of "List Folder / Read Data” is removed it causes this problem. This was set to try and prevent people from looking at the logs but still allow them to append data.

I can't explain it but that's the way it seems to work.

Is there any way to hide this directory from users but still have them write to it for the audit log? Attrib to hidden will not work because, you just show hidden files and folders and your in.

I’m still testing so I’m not saying this is the fix just yet but it looks promising.


Report Offensive Follow Up For Removal


Response Number 6
Name: Mechanix2Go
Date: August 10, 2005 at 20:57:53 Pacific
Reply: (edit)

I don't have a network to try it with.

If this line is being run hours, or days, apart is there a chance that the usage.txt is being deleted between runs?

Try running the line twice in rapid succession.

Only two other things come to mind, equally Zappa-esque.

Try changing to the q: drive.

Try >>>


M2


If at first you don't succeed, you're about average.


Report Offensive Follow Up For Removal






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software