Werbes Posted July 24, 2008 Share Posted July 24, 2008 Hi, I have not access to the example scripts site muttley - så i post my example here :-) Func ShareRemoteFolder($Computer, $FolderToShare, $ShareName, $ShareDesc) if FileExists(@TempDir & "\ShRmFl.vbs") Then FileDelete(@TempDir & "\ShRmFl.vbs") EndIf FileWriteLine(@TempDir & "\ShRmFl.vbs", 'Set objWMIService = GetObject ("winmgmts:\\' & $Computer & '\root\cimv2")' & @crlf & 'Set objNewShare = objWMIService.Get("Win32_Share")' & @CRLF & 'errReturn = objNewShare.Create ("' & $FolderToShare & '", "' & $ShareName & '", 0, 1000, "' & $ShareDesc &'.")' & @crlf) RunWait(@ComSpec & " /c " & "cscript " & @TempDir & "\ShRmFl.vbs") EndFunc /Emil Link to comment Share on other sites More sharing options...
d3mon Posted July 24, 2008 Share Posted July 24, 2008 Hi, I have not access to the example scripts site muttley - så i post my example here :-) Func ShareRemoteFolder($Computer, $FolderToShare, $ShareName, $ShareDesc) if FileExists(@TempDir & "\ShRmFl.vbs") Then FileDelete(@TempDir & "\ShRmFl.vbs") EndIf FileWriteLine(@TempDir & "\ShRmFl.vbs", 'Set objWMIService = GetObject ("winmgmts:\\' & $Computer & '\root\cimv2")' & @crlf & 'Set objNewShare = objWMIService.Get("Win32_Share")' & @CRLF & 'errReturn = objNewShare.Create ("' & $FolderToShare & '", "' & $ShareName & '", 0, 1000, "' & $ShareDesc &'.")' & @crlf) RunWait(@ComSpec & " /c " & "cscript " & @TempDir & "\ShRmFl.vbs") EndFunc /Emil If you have access here and not exemple script....perhaps you use explorer haha use firefox or go to this link : http://www.autoitscript.com/forum/index.php?showforum=9 No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now