Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Help to create a regular LAN to share drives/folders - not Home

16 Sep 2015   #91
ozstar

Win 7 Pro 32 and 64 versions
 
 

Yes that works..

Connected from Lenovo2..

got Video K: drive/folders/files.

Still get No access on others.


My System SpecsSystem Spec
.
16 Sep 2015   #92
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

The Network group works. Let's apply it to all drives now, while stripping HomeUsers from them.

Place the following script in the same directory as the "shares-list.csv" file and run. After it's done, test your access to your shares.

set_ntfs_permissions_2.bat
Code:
@echo off
setlocal EnableDelayedExpansion
REM Set NTFS permissions on share paths
 
set "shares_csv=%~dp0\shares-list.csv"
goto :main
 
:PromptUacAndFocus ScriptFullPath
setlocal
    set "temp1="%TEMP%\%~nx0_1_%RANDOM%.vbs""
    set "temp2="%TEMP%\%~nx0_2_%RANDOM%.vbs""
    net sess>NUL 2>&1||goto 2>NUL||(
        ( echo CreateObject^("Shell.Application"^).ShellExecute "%~1",,,"RunAs",1) > %TEMP1%
        (
            echo strTmpFile_1 = %TEMP1%
            echo strTmpFile_2 = %TEMP2%& echo.
            echo Function CountWindowInstance^(strProcessName^)
            echo     CountWindowInstance = GetObject^("winmgmts:\\.\root\cimv2"^).ExecQuery^("Select * from Win32_Process Where Name = '" ^& strProcessName ^& "'"^).Count
            echo End Function& echo.
            echo Set WshShell = CreateObject^("WScript.Shell"^)& echo.
            echo For I = 0 To 1
            echo     If CountWindowInstance^("consent.exe"^) ^> 1 Then WScript.Sleep 200 Else WScript.Sleep 50
            echo     WshShell.AppActivate^("User Account Control"^)
            echo Next& echo.
            echo On Error Resume Next& echo.
            echo With CreateObject^("Scripting.FileSystemObject"^)
            echo     If .FileExists^(strTmpFile_1^) Then .DeleteFile^(strTmpFile_1^)
            echo     If .FileExists^(strTmpFile_2^) Then .DeleteFile^(strTmpFile_2^)
            echo End With
        ) > %TEMP2%
        for /l %%_ in (1,1,2) do ping >NUL
        start WScript %TEMP1%
        for /l %%_ in (1,1,2) do ping >NUL
        start WScript %TEMP2%
        for /l %%_ in (1,1,2) do ping >NUL
        exit
    )
endlocal
goto :eof
 
:main
call :PromptUacAndFocus %0
 
for /f "skip=1 delims=" %%I in ('type "%SHARES_CSV%"') do (
    for /f "usebackq tokens=1,2,3 delims=," %%J in ('%%I') do (
        set "locations=!LOCATIONS!,%%~K"
    )
)
 
for %%I in (%LOCATIONS%) do (
    set "location=%%~I"
    icacls "!LOCATION:\=/!" /grant:r "Network:(OI)(CI)(F)" /c
)
 
REM remove the HomeUsers group from each %LOCATIONS%: 
 
for %%I in (%LOCATIONS%) do (
    set "location=%%~I"
    icacls "!LOCATION:\=/!" /remove "HomeUsers" /c
)
 
echo.& echo Done.& echo.& echo Press any key to exit...& pause >NUL
My System SpecsSystem Spec
16 Sep 2015   #93
ozstar

Win 7 Pro 32 and 64 versions
 
 

OKay running now

9:50pm Down to L:/ some time to go yet...
My System SpecsSystem Spec
.

16 Sep 2015   #94
GokAy

Windows 7 Ultimate x64 SP1
 
 

Hmm, I just noticed something and I wonder if it was part of the problem we had earlier with correct credentials not granting access. Bah, we may have lost the time over nothing

- When you were accessing Webmain from Lenovo with password protection off, the open session was Guest (you know this by now)
- After turning on password protection, you got asked for credentials (which we wanted)
- But since the session was still open on Lenovo (even if you close the session on Webmain), Lenovo was trying to use the open session even if you entered correct credentials
- Restarting/relogging or running this command ("net use * /del" ) would correct the issue (need to close session on both PCs). Command may be deleting drive/folder maps though. (Ok, checked and mapped folders were unaffected)

I was testing with password protected sharing off, and after turning it on, I wasn't granted access with my admin account. First I tried closing the session on my "Webmain" and it still didn't grant access. Then it hit me to delete the connections on my "Lenovo"
My System SpecsSystem Spec
16 Sep 2015   #95
ozstar

Win 7 Pro 32 and 64 versions
 
 

Then, I assume it worked! That's right, the last time I did not reboot both Lenovo2 and Webmain.

The script is still running and from where it's at now L:\ second time around, I think a few hours to go through the 2 ext 2TB drives.

It sure has been a marathon !

I love working with scripts though lost touch with it now. Reminds me of my time at it before Windows 30/40 years ago. The guys with Linux are still living it although that too is changing. Linux Mint 17 is a good example.

My son is an Analyst using mainly Net but also the C family and others.

Anyway, just a bit of banter to loosen up this morning !
My System SpecsSystem Spec
16 Sep 2015   #96
GokAy

Windows 7 Ultimate x64 SP1
 
 

Good morning by the way Will head to bed myself in an hour or so. I guess I won't be up to see the result tonight.
My System SpecsSystem Spec
16 Sep 2015   #97
ozstar

Win 7 Pro 32 and 64 versions
 
 

Must be late there ! Nice sunny day here with a cool breeze!!

Yes hopefully it won't be too long, although it may take another few hours to complete.

It is still blinking away on L:\ and has been for a few hours.

Can't thank you guys enough for your help. I remember I used to have weird things happen with Win 95 and 98, then Xp came along..

Enjoy your sleep..
My System SpecsSystem Spec
16 Sep 2015   #98
ozstar

Win 7 Pro 32 and 64 versions
 
 

Update: Still at L:\ blinking however can access all drives/folders/files on Webmain from all boxes. Great news..
My System SpecsSystem Spec
16 Sep 2015   #99
ozstar

Win 7 Pro 32 and 64 versions
 
 

Okay Done !

All drive/folders and files are accessible

Woo Hoo...
My System SpecsSystem Spec
17 Sep 2015   #100
GokAy

Windows 7 Ultimate x64 SP1
 
 

Good job
My System SpecsSystem Spec
Reply

 Help to create a regular LAN to share drives/folders - not Home




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Windows won't paste folders into different folders or drives.
Hi, I've been trying to sort this problem for 2 days and it's driving me nuts! I can copy folder(s) but when I try to paste them into another folder or drive I get a pop-up - Microsoft Visual C++ Runtime Library Runtime Error! Program C:\windows\explorer.exe abnormal program termination. ...
General Discussion
My computer is changing regular folders to screen saver? Please help
I don't know why my computer started doing this but yesterday I was going through one of my folders and I noticed the sub folders all looked a little strange. When I single click the folder to view details it says the name of the folder and right under that it says "screen saver." Usually it says...
General Discussion
How do i share folders on other hard drives?
Options for network sharing are already turned on and am successfully sharing folders on main drive C: Additional hard drives in computer - S and U , both will not share any folders. Checked security and sharing settings compared to a folder that was successfully being shared , options are...
Network & Sharing
Reinstall Windows 7 Home SSD or Regular HD?
If you are reinstalling Windows 7 and detects 2 separate main hard drives (32gb SSD and 466gb HD) , which one do you install it to? SSD or HD? Thanks
Hardware & Devices
Home network can share printers but not folders or entire disks
Dear Windows 7 Home Network Experts, After hours of trying, I can see my 2 compupters on the Home Network. I can share printers, but no matter what I do, I cannot access folders or hard disks. I have: - encabled sharing - disabled firewall The messages I get are: Windows cannot access...
Network & Sharing
how do i share a folder on a workgroup without home share?
i've enabled homeshare and now can't seem to turn it off. All users on the workgroup can see all folders in homeshare. Which isn't what i want i just want to share the documents folder and that's it. ive turned off omeshare and they are all sill showing up. I've also right clicked on the documents...
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 14:56.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App