Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: For command Help..  (Read 2223 times)

0 Members and 1 Guest are viewing this topic.

BP

  • Guest
For command Help..
« on: May 28, 2008, 10:21:50 AM »
I'm not a scripter, but I think the FOR command tool can help me achieve what I want to do. I need to run a job so that it can create a share within MS Cluster software according to the clustername. So I have found how I can create a resource in cluster by following:
cluster . res "Testshare" /create /group:"ClusterResourcename" /type:"File Share"
cluster . res "Testshare" /priv path="e:\XPPUB"
cluster . res "Testshare" /priv Sharename=XPPUB
cluster . res "Testshare" /priv Remark="XPPUB Share"
cluster . res "Testshare" /prop Description="XPPUB Share"
cluster . res "Testshare" /AddDep:"Disk L:"
cluster . res "Testshare" /AddDep:ClusterResourcename"

My challenge is I have multiple ClusterResourcenames and they all differ, so if someone can help me on this.

Thanks,

.bat_man

  • Guest
Re: For command Help..
« Reply #1 on: May 29, 2008, 02:20:15 AM »
hi

u can do that by putting all the ClusterResourcename's line by line in side a file as clstr.txt for eg

and do this bat file

for /f "" %%i in (clstr.txt) do (
cluster . res "Testshare" /create /group:"%%i" /type:"File Share"
cluster . res "Testshare" /priv path="e:\XPPUB"
cluster . res "Testshare" /priv Sharename=XPPUB
cluster . res "Testshare" /priv Remark="XPPUB Share"
cluster . res "Testshare" /prop Description="XPPUB Share"
cluster . res "Testshare" /AddDep:"Disk L:"
cluster . res "Testshare" /AddDep:%%i"
)

put i dont know if the commands u wrot are dos or not if not they will not work