darkleton Posted May 22, 2007 Share Posted May 22, 2007 OK I have AutoIT creating an active directory share, that all works fine. The problem is with these two lines: Const $MAXIMUM_CONNECTIONS = 25 $errReturn = $objNewShare.Create ("C:\Shares\" & $username, $username, $FILE_SHARE, $MAXIMUM_CONNECTIONS, "Public share for" & $username) It creates the share with 25 max connections. According to Microsofts help pages, if I remove the constant line and just leave the value blank it should add unlimited connections. I've tried commenting out the constant line and changing $MAXIMUM_CONNECTIONS on the second line to "" but it then adds 1 connection instead. I don't know what to do to get it as unlimited connections. It's not a major issue, I can just up it to say 50 connections but it's just bugging me. Any help would be much appreciated Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 22, 2007 Share Posted May 22, 2007 I don't see any example in TechNet actually showing how it looks in VBS to leave a parameter blank. One assumes "" should work, but I know VBS has some alternate versions of NUL characters. Try it completely with -1: Const $MAXIMUM_CONNECTIONS = -1 $errReturn = $objNewShare.Create ("C:\Shares\" & $username, $username, $FILE_SHARE, $MAXIMUM_CONNECTIONS, "Public share for" & $username) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
darkleton Posted May 23, 2007 Author Share Posted May 23, 2007 I don't see any example in TechNet actually showing how it looks in VBS to leave a parameter blank. One assumes "" should work, but I know VBS has some alternate versions of NUL characters. Try it completely with -1: Const $MAXIMUM_CONNECTIONS = -1 $errReturn = $objNewShare.Create ("C:\Shares\" & $username, $username, $FILE_SHARE, $MAXIMUM_CONNECTIONS, "Public share for" & $username) Thanks for that, I don't know why I didn't even think of using -1, I was using 0 or "" all the time!! Thanks again 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