I need a script to create the same shared folder on 50 remote Windows Server 2003.
I have tried with psexec but havent got the syntax correct yet
psexec @c:\serverlist.txt cmd net share ShareName="e:\Share" /Remark:"Shared Folder" -d
Any help would be appreciated.
You certainly call
net share
withpsexec
if you want to, but thermtshare.exe
utility would probably be the tool that I'd use.In your command line you don't need the
cmd
and the-d
(which is, presumably, apsexec
argument) is in the wrong place. I think you're looking forpsexec @c:\serverlist.txt -d net share ShareName="e:\Share" /Remark:"Shared Folder"
instead.I would use RMTSHARE.exe as well. Give that you have a list of servers in serverlist.txt, I would run the following at a command prompt:
This will create a share named "ShareName" that is sharing e:\share with the remark "Shared Folder" and the default share permissions of Everyone: Read