Wednesday, October 17, 2012

Windows 7 Folder Redirection rename the Home folder in "My Documents

PowerShell script to fix the problem:
$myLocations="\\share1\allusers","\\share2\users","\\pshare3\AdminUsers"

foreach ($loc in $myLocations)
{

    set-location $loc
    $items=Get-ChildItem
    foreach ($item in $items)
    {
      if ($item.getType().name -like "DirectoryInfo")
      {
          cd $item.name
          if (test-path desktop.ini) {del .\desktop.ini -force}
          cd ..
      }
    }
}

No comments:

Post a Comment