Workaround for HomeGroup reset permission issue

Hi at All,

as somebody, I faced the famous issue that reset HomeGroup permission to Read and eXecute on folders that reside in a different drive than C and that  are in the Windows 8 default libraries.

I explain you how I solved this issue. It's a workaround not a solution, I hope Microsoft is going to publish a patch for this nasty bug.

In few words, I use Scheduled Tasks to start every logon a script which set Homegroup permission to Full control on the folder of interests.

I publish how to apply this workaround.

1) List all folders that you have added in your Windows Library
     For example, I have added F:\Pictures F:\Video F:\Music F:\Documents in my Windows 8 Library.

2) Create a text file with notepad in C:\folderslist.txt and write the folder you listed in the previous step.
     Remember to put one folder per line, not more. For example, my folderslist.txt is :

     F:\Pictures
     F:\Video
     F:\Music
     F:\Documents

    Save the file and close it.

3) Create a text file, again with notepad, named setPerm.cmd  and save in C:\ .
     Please write these command in the file:

     FOR /F %%I IN (C:\folderslist.txt) DO icacls "%%I" /C /Q /T /grant HomeUsers:(OI)(CI)(F)

     Save and close it.
     When we run this script, it reads the file folderlist.txt , get the path of  folders we listed in the step 1 and set Read and Write permission for Homeusers.

4) Now test it. If all worked correctly you should be able to write from a computer in the Home Group.

5) We have to schedule this permission every logon. How do we do? With this command:

    SCHTASKS /Create /SC ONLOGON /TN setPermTask /TR c:\setPerm.cmd /DELAY 0002:00 /RU System

    You must run this command in an elevated command prompt. Open the Task Manager, click File, click New Task, write cmd , check the flag run as Administrator and click run.

    You should see a command prompt, copy the line above, paste in the black window and press enter.

    If you do that correctly, you won't see error messages.

    Ok, what did we do? We created a task that run every logon and start the script which set correctly homegroup permissions on our folders.

    The task doesn't start at once, the system wait 2 minutes before run the script.  Remember that the bug reset the folder permission after we logon, so we have to take a while before setup permission correctly. If we don't care about this, we will have broken permission.

   The last detail, our PC run the script as System user so we won't see the ugly black box, if you want to see remove /RU System from the command above.

6) Reboot your computer and check if the workaround works.

Please comment the workaround and tell me if it works for you. If you know other workarounds please tell me.

 Emiliano

 


February 19th, 2013 11:00pm

Thanks for sharing.
Free Windows Admin Tool Kit Click here and download it now
February 21st, 2013 9:29am

Great script - worked first time and every time.

As the author of the script, I wonder if you have any views on how to modify it to avoid the problem I have using Windows 8 as a server.  Whenever a user logs on to the server directly, the logon will reset the permissions, and your script will then run two minutes later.  In that time, any user who is accessing data on the server will find they do not have write permission.  It is only a two person office where this happens, but I would like to find a solution. 

The only thought I have is to run three versions of the script; at logon, logon plus 1 minute and logon plus two minutes.  Any thoughts?

Michael

April 22nd, 2013 7:44pm

I have this problem with the Default Documents, Videos, etc. folders.  I will try your script.
Free Windows Admin Tool Kit Click here and download it now
October 15th, 2013 8:59pm

Hi at All,

as somebody, I faced the famous issue that reset HomeGroup permission to Read and eXecute on folders that reside in a different drive than C and that  are in the Windows 8 default libraries.

I explain you how I solved this issue. It's a workaround not a solution, I hope Microsoft is going to publish a patch for this nasty bug.

In few words, I use Scheduled Tasks to start every logon a script which set Homegroup permission to Full control on the folder of interests.

I publish how to apply this workaround.

1) List all folders that you have added in your Windows Library
     For example, I have added F:\Pictures F:\Video F:\Music F:\Documents in my Windows 8 Library.

2) Create a text file with notepad in C:\folderslist.txt and write the folder you listed in the previous step.
     Remember to put one folder per line, not more. For example, my folderslist.txt is :

     F:\Pictures
     F:\Video
     F:\Music
     F:\Documents

    Save the file and close it.

3) Create a text file, again with notepad, named setPerm.cmd  and save in C:\ .
     Please write these command in the file:

     FOR /F %%I IN (C:\folderslist.txt) DO icacls "%%I" /C /Q /T /grant HomeUsers:(OI)(CI)(F)

     Save and close it.
     When we run this script, it reads the file folderlist.txt , get the path of  folders we listed in the step 1 and set Read and Write permission for Homeusers.

4) Now test it. If all worked correctly you should be able to write from a computer in the Home Group.

5) We have to schedule this permission every logon. How do we do? With this command:

    SCHTASKS /Create /SC ONLOGON /TN setPermTask /TR c:\setPerm.cmd /DELAY 0002:00 /RU System

    You must run this command in an elevated command prompt. Open the Task Manager, click File, click New Task, write cmd , check the flag run as Administrator and click run.

    You should see a command prompt, copy the line above, paste in the black window and press enter.

    If you do that correctly, you won't see error messages.

    Ok, what did we do? We created a task that run every logon and start the script which set correctly homegroup permissions on our folders.

    The task doesn't start at once, the system wait 2 minutes before run the script.  Remember that the bug reset the folder permission after we logon, so we have to take a while before setup permission correctly. If we don't care about this, we will have broken permission.

   The last detail, our PC run the script as System user so we won't see the ugly black box, if you want to see remove /RU System from the command above.

6) Reboot your computer and check if the workaround works.

Please comment the workaround and tell me if it works for you. If you know other workarounds please tell me.

 Emiliano

 



November 16th, 2013 3:35pm

This worked great. The only thing I would add is that when running the test you have to change the two instances of %%I to %I.  The use of the %% is only for batch files and is needed to run in the Task Scheduler.

Thanks for sharing this.

Free Windows Admin Tool Kit Click here and download it now
November 16th, 2013 7:11pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics