Darren
Wed Aug 16 17:26:02 CDT 2006
I was refreshing the form before i was making the share routine run now i
have embeded the code from Liz into the main Sub routine it is working.
Many thanks for all your suggestions
Darren
"Tom Lavedas" wrote:
> This line in your createshare routine seems to have a couple of syntax
> errors ...
>
> errReturn = objNewShare.Create _
> strfolders & "\" & strusers & "," strusershare & "," FILE_SHARE, _
> MAXIMUM_CONNECTIONS, "Public share for the Finance group.")
>
>
> It's missing two ampersands - one after each quoted comma. I believe
> it should read ...
>
> errReturn = objNewShare.Create _
> strfolders & "\" & strusers & "," & strusershare & "," & FILE_SHARE,
> _
> MAXIMUM_CONNECTIONS, "Public share for the Finance group.")
>
> Tom Lavedas
> ============
>
http://members.cox.net/tglbatch/wsh
>
> Darren wrote:
> > Hi Liz
> > thx for your response here goes. This is a HTA for use at a
> > school i work in. Because we have so many staff and pupils go through the
> > school i wanted to design our own user manager that creates the username maps
> > the drives and all the other stuff that comes with setting up a user.
> > The main problem with this is when i try to concatenate the string variable
> > and suffix the share with a $ to hide it on the network also concatenating
> > the folder string variable causes me problems as with my other post.
> >
> > The Sub Routine is called createshare all the other part of the code works
> > fine
> >
> > many thanks
> >
> > Darren
>
> {snip}
>
> > 'Share Pupil Folder
> > '************************************************************************************************
> > Sub createshare
> >
> > strserver = (Serverlist.value)
> > strusers = (usernametxt.value)
> > strGroup = (grouptxt.value)
> > strpassword = (passwordtxt.value)
> > strlenpassword = Len(strpassword)
> > strfolders = (foldertxt.value)
> > strusershare = (foldertxt.value) & "$"
> >
> > Const FILE_SHARE = 2147483648
> > Const MAXIMUM_CONNECTIONS = 0
> > strcomputer = "."
> > Set objWMIService = GetObject("winmgmts:" _
> > & "{impersonationLevel=impersonate}!\\" & strcomputer & "\root\cimv2")
> > Set objNewShare = objWMIService.Get("Win32_Share")
> >
> > errReturn = objNewShare.Create _
> > strfolders & "\" & strusers & "," strusershare & "," FILE_SHARE, _
> > MAXIMUM_CONNECTIONS, "Public share for the Finance group.")
> >
> >
> > Msgbox errReturn
> >
> >
> >
> > End Sub
>
> {snip}
>
> >
> > "Liz" wrote:
> >
> > > How about posting your altered code segment, as well as the value in
> > > the variables that the error occurs with.
> > >
>
>