1.

Solve : For command Help..?

Answer»

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,
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



Discussion

No Comment Found