PDA

View Full Version : Sharing a Folder across a WORKGROUP



griffo
06-15-2008, 11:32 AM
Hi Friedrich

I am trying to build a feature into a couple of setups for use on an XP based Workgroup network.

Machine A has the program and the backend SQL db.
Machine M is where I want to create a shortcut to the exe on machine A

I can use "Add/Remove Shared Resource" to create the 'share' on machine A and "Map/Disconnect Network Drive" on machine B.

Problem is that Windows blocked the access from machine B - no permission...

So, when I try use "Set Access Control" on machine A, the dialogue asks for the Domain and Username. But I need to do this on a workgroup LAN.

Is there a way to do this?

John

linder
06-16-2008, 12:43 AM
Hi John,

To be honest, I don't know the answer to your question. The information should be on MSDN - I did a quick MSDN and Google search but was unable to find a good link.

So I fear you have to contact Microsoft to find out how to do this :(

Friedrich

linder
06-16-2008, 12:44 AM
By the way, if possible please keep us posted.

Friedrich

griffo
06-16-2008, 10:04 AM
I will do some investigating and see what I can come up with.

I can seem to do it If I manually mess with the sharing properties of the shared folder, after call to "Add Shared Resource" from within SetupBuilder program.

Once SB has created the share, both the checkboxes for "Share this folder on the network" and "Allow network users to change my files" are checked, but windows still does not allow connect from workgroup client PC.

So, if I uncheck [ ] "Allow network users to change my files" and click the [Apply] button, then re-cjeck [x] "Allow network users to change my files" and hit [Apply] again, it all works - that is, the connection is then allowed from the client PC. But it seems I need to do this manually :(

Will report any further finding back.

John

griffo
06-16-2008, 01:11 PM
I determined that manually un-checking / apply / checking / apply the "Allow network users to change my files" settings for the newly created shared folder added a registry entry to
HKLM\system\CurrentControlSet\Services\lanmanserve r\shares\security

So I tried setting this with EditRegistry from within my sb installer.

I was able to set the key to match other working shares, but it still would not work to allow remote access from another workgroup computer.
The manual process appears to also do something else within the NTFS system.

So it looks like we are stuck with doing the manual steps. I searched MSDN and several sites and there was a change in this area in XP SP1. But later fixed in SP2.

John

griffo
06-16-2008, 06:29 PM
Finally, I have got it to work.

I will document it and post a link here within a day or two.

linder
06-17-2008, 12:18 AM
John,

Wow, that would be great. Thank you very much.

Friedrich

griffo
06-17-2008, 08:57 AM
I did a search on the internet and found several references to the commandline program CACLS.EXE

So I messed with it and managed to get it to do what IO wanted.. i.e. Set the access properties for the SHAREd folder I had just created

I was able to call a commandline batch from within SB6 with this line..

cmd.exe /c c:\a\sb6a.bat

The sb6a.bat contained ...
ECHO Y| cacls C:\a\SB6tst /E /T /C /G "Everyone":C

where C:\SB5tst was the shared folder

This worked fine with no user intervention by piping in the Y

But later I thought, perhaps I need to try again using the SB inbuild "Set Access Control" now that I could see what CACLS was doing.
Figuring that the SB was probably using CACLS, I tested with the inbuilt SetAccessControl function and left the DOMAIN field blank and set username to everyone.
VOILA -- It works great! :) No need for the batch file, no need for the commandline call.


John.

linder
06-17-2008, 09:04 AM
Hi John,

PERFECT. That's great. Thanks so much for sharing this information :) Very interesting!

BTW, SetupBuilder does not make use of CACLS. It uses native Windows APIs to handle ACL manipulation.

Friedrich