[windows2000] Batch for in-loops

  • From: "Sorin Srbu" <sorin.srbu@xxxxxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Fri, 5 Sep 2008 12:00:36 +0200

I can't get this to work...

Had a fileserver fail a disk in a raid, fixed it and all files are now 
transferred back from backup. All files are owned by Administrator which kinda' 
messes up the quotas.

So, I found this tool, called chown and it works well, only I have some 120ish 
homefolders I need to change the owner on.

I figured I could do a for in batch-loop and I can't make it work. What I've 
done so far:

* created a simple text file, users.txy, with all the folders I want changed. 
All folders have the same name as the user in question.

* on a command line I typed "for %A in users.txt do chown -v -q %A %A" and ran 
it. Got an error "users.txt was unexpected at this time".
        Ie for folder User1 use CLI-tool chown to change the folder User1 to be 
by User1 and do it quietly and verbosely in case a fatal error happens.

What gives? I do believe I've done this before. Did I mix up the order on the 
command line?


# Sorin Srbu                            [Sysadmin, Systems Engineer]
# Dept of Medicinal Chemistry,  Phone: +46 (0)18-4714482 >3 signals> GSM
# Div of Org Pharm Chem,                Mobile: +46 (0)701-718023
# Box 574, Uppsala University,  Fax: +46 (0)18-4714482
# SE-751 23 Uppsala, Sweden     Visit: BMC, Husargatan 3, D5:512b
#                                       Web: http://www.orgfarm.uu.se
# ()  ASCII ribbon campaign - Against html E-mail
# /\
# MotD follows:
# Legacy MS Tag: "If you can't make it good, make it LOOK good." -Bill Gates

Other related posts: