Article ID: 977229 - Last Review: October 6, 2011 - Revision: 2.0 You are unable to update the target location of offline file shares in the Offline File client side cache without administrative permission in Windows Server 2008 R2 or in Windows 7
On This PageSYMPTOMSConsider the following scenario: Scenario 1
Scenario 2
RESOLUTIONTo resolve this problem, install the following hotfix on the affected computer. After you install the hotfix, you can update the shared folder record in the CSC cache without administrative credentials. Hotfix informationA supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix. Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: http://support.microsoft.com/contactus/?ws=support
(http://support.microsoft.com/contactus/?ws=support)
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.PrerequisitesTo apply this hotfix, you must be running Windows 7 or Windows Server 2008 R2.Registry informationNotes
322756
(http://support.microsoft.com/kb/322756/
)
How to back up and restore the registry in Windows To use the hotfix in this package, you must create a registry key. To do this, follow these steps:
Restart requirementYou must restart the computer after you apply this hotfix.Hotfix replacement informationThis hotfix does not replace a previously released hotfix.File informationThe global version of this hotfix installs files that have the attributes that are listed in the following tables. The dates and the times for these files are listed in Coordinated Universal Time (UTC). The dates and the times for these files on your local computer are displayed in your local time together with your current daylight saving time (DST) bias. Additionally, the dates and the times may change when you perform certain operations on the files.Windows 7 and Windows Server 2008 R2 file information notesImportant Windows 7 hotfixes and Windows Server 2008 R2 hotfixes are included in the same packages. However, hotfixes on the Hotfix Request page are listed under both operating systems. To request the hotfix package that applies to one or both operating systems, select the hotfix that is listed under "Windows 7/Windows Server 2008 R2" on the page. Always refer to the "Applies To" section in articles to determine the actual operating system that each hotfix applies to.
For all supported x86-based versions of Windows 7Collapse this table
For all supported x64-based versions of Windows 7 and of Windows Server 2008 R2Collapse this table
For all supported IA-64-based versions of Windows Server 2008 R2Collapse this table
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. MORE INFORMATIONFor more information about how to configure the computer after you install the hotfix, follow these steps to achieve the desired behavior described above by scenario 1:
For more information about how to configure the computer after you install the hotfix, follow these steps to achieve the desired behavior described above by scenario 2:
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
'
' Usage: CscRename.vbs /OldItemPath:<path> /NewItemPath:<path> [/Machine:value] [/User:value] [/Password:value]
'
'
' Demonstrates how to rename an item in the Ofline Files cache.
'
' OldItemPath - UNC path of the current path to be renamed.
'
' NewItemPath - UNC path of the new path to replace the old path.
'
' If NewItemPath already exists, the operation is not performed.
' This operation simply schedules a rename to be performed on the next restart
' of the system.
'
const cComputerName = "LocalHost"
const cWMINamespace = "root\cimv2"
const cWMIClass = "Win32_OfflineFilesCache"
Const wbemFlagReturnImmediately = &h10
nRenameItemExFailureCount = 0
nRenameItemFailureCount = 0
'
' Process commandline arguments
'
strOldItemPath = WScript.Arguments.Named("OldItemPath")'
if Len(strOldItemPath) = 0 Then
Wscript.Echo "OldItemPath parameter required"
Err.Raise 449 ' "argument not optional" error
End if
strNewItemPath = WScript.Arguments.Named("NewItemPath")
if Len(strNewItemPath) = 0 Then
Wscript.Echo "NewItemPath parameter required"
Err.Raise 449 ' "argument not optional" error
End if
strComputerName = WScript.Arguments.Named("Machine")
If Len(strComputerName) = 0 Then strComputerName = cComputerName
strUserID = WScript.Arguments.Named("User")
If Len(strUserID) = 0 Then strUserID = ""
strPassword = WScript.Arguments.Named("Password")
If Len(strPassword) = 0 Then strPassword = ""
set objWMILocator = WScript.CreateObject("WbemScripting.SWbemLocator")
Set objWMIServices = objWMILocator.ConnectServer(strComputerName, _
cWMINameSpace, _
strUserID, _
strPassword)
'
' Note that Win32_OfflineFilesCache is a singleton.
'
strTempOldItemPath = Replace(strOldItemPath,"\","\\")
Set objWMIService = GetObject("winmgmts:\\" & cComputerName & "\root\CIMV2")
Set objCache = objWMIServices.Get("Win32_OfflineFilesCache=@")
'
'Find the path of the item to be renamed in the cache
'
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OfflineFilesItem WHERE ItemPath ='" &strTempOldItemPath&"'", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
'
'If folder is pinned we need to rename all the directory items underneath this
'
If (objItem.PinInfo.Pinned = True) Then
'
'Find all the directories underneath the folder in the cache
'
Set childItems = objWMIService.ExecQuery("SELECT * FROM Win32_OfflineFilesItem WHERE ParentItemPath = '" &strTempOldItemPath&"'", "WQL", _
wbemFlagForwardOnly + wbemFlagReturnImmediately )
For Each childItem In childItems
strOldPath = childItem.ItemPath
'
'Item to be renamed in the cache
'
strTempNewItemPath = strNewItemPath & "\" & childItem.ItemName
On Error Resume Next
'
' Note that while we pass "False" for the bReplace parameter, that
' parameter is ignored. Existing destinations are never replaced, regardless
' of what we pass for the 3rd parameter.
'
objCache.RenameItemEx strOldPath, strTempNewItemPath, False
hr = Hex(Err.Number)
If Err.Number <> 0 Then
WScript.Echo "RenameItem Failed with error:" &hr
WScript.Echo "While renaming:" & strOldPath & " to:" &strTempNewItemPath
Err.Clear
nRenameItemExFailureCount = nRenameItemExFailureCount + 1
On Error Resume Next
'
'We got the error in renaming this may happen due to item in use, try to renaname after reboot
'
objCache.RenameItem strOldPath, strNewItemPath, False
hr = Hex(Err.Number)
If Err.Number <> 0 Then
WScript.Echo "RenameItem Failed with error:" &hr
WScript.Echo " While renaming:" & strOldPath & " to:" &strTempNewItemPath
Err.Clear
nRenameItemFailureCount = nRenameItemFailureCount + 1
Else
WScript.Echo "item rename scheduled. A restart of the system is necessary to apply the change."
End If
Else
WScript.Echo "Renamed:" &strOldPath & " to:" &strTempNewItemPath & " SUCCESSFULLY"
End If
Next
Else
'
'Find all the directory items underneath the folder in the cache
'
Set childItems = objWMIService.ExecQuery("SELECT * FROM Win32_OfflineFilesItem WHERE ParentItemPath = '" &strTempOldItemPath&"'", "WQL", _
wbemFlagForwardOnly + wbemFlagReturnImmediately )
For Each childItem In childItems
'
'If this item is pinned and a directory, rename it
'
If (childItem.PinInfo.Pinned = True) Then
strOldPath = childItem.ItemPath
strTempNewItemPath = strNewItemPath & "\" &childItem.ItemName
On Error Resume Next
' Note that while we pass "False" for the bReplace parameter, that
' parameter is ignored. Existing destinations are never replaced, regardless
' of what we pass for the 3rd parameter.
'
objCache.RenameItemEx strOldPath, strTempNewItemPath, False
hr = Hex(Err.Number)
If Err.Number <> 0 Then
On Error Resume Next
WScript.Echo "RenameItemEx Failed with error:" &hr
WScript.Echo "While renaming:" & strOldPath & " to:" &strTempNewItemPath
Err.Clear
nRenameItemExFailureCount = nRenameItemExFailureCount + 1
On Error Resume Next
'
'We got the error in renaming this may happen due to item in use, try to renaname after reboot
'
objCache.RenameItem strOldPath, strTempNewItemPath, False
hr = Hex(Err.Number)
If Err.Number <> 0 Then
On Error Resume Next
WScript.Echo "RenameItem Failed with error:" &hr
WScript.Echo "While renaming:" & strOldPath & " to:" &strTempNewItemPath
Err.Clear
nRenameItemFailureCount = nRenameItemExFailureCount + 1
Else
WScript.Echo "item rename scheduled. A restart of the system is necessary to apply the change."
End If
Else
WScript.Echo "Renamed:" &strOldPath & " to:" &strTempNewItemPath & " SUCCESSFULLY"
End If
End If
Next
End If
If (nRenameItemExFailureCount > 0 & (nRenameItemExFailureCount - nRenameItemFailureCount) > 0) Then
WScript.Echo "item rename scheduled. A restart of the system is necessary to apply the change."
ElseIf (nRenameItemExFailureCount = 0) Then
WScript.Echo "Items Renamed SUCCESSFULLY"
Else
WScript.Echo "ItemsRenamed FAILED"
End If
Next'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
'
' Usage: CscRenameItemEx.vbs /OldItemPath:<path> /NewItemPath:<path> [/Machine:value] [/User:value] [/Password:value]
'
'
' Demonstrates how to rename an item in the Ofline Files cache.
'
' OldItemPath - UNC path of the current path to be renamed.
'
' NewItemPath - UNC path of the new path to replace the old path.
'
' If NewItemPath already exists, the operation is not performed.
' If OldItemPath is currently in use,this operation simply schedules
' a rename to be performed on the next restart.
'
'
On Error Resume Next
const cComputerName = "LocalHost"
const cWMINamespace = "root\cimv2"
const cWMIClass = "Win32_OfflineFilesCache"
'
' Process commandline arguments
'
strOldItemPath = WScript.Arguments.Named("OldItemPath")'
if Len(strOldItemPath) = 0 Then
Wscript.Echo "OldItemPath parameter required"
Err.Raise 449 ' "argument not optional" error
End if
strNewItemPath = WScript.Arguments.Named("NewItemPath")'
if Len(strNewItemPath) = 0 Then
Wscript.Echo "NewItemPath parameter required"
Err.Raise 449 ' "argument not optional" error
End if
strComputerName = WScript.Arguments.Named("Machine")
If Len(strComputerName) = 0 Then strComputerName = cComputerName
strUserID = WScript.Arguments.Named("User")
If Len(strUserID) = 0 Then strUserID = ""
strPassword = WScript.Arguments.Named("Password")
If Len(strPassword) = 0 Then strPassword = ""
set objWMILocator = WScript.CreateObject("WbemScripting.SWbemLocator")
Set objWMIServices = objWMILocator.ConnectServer(strComputerName, _
cWMINameSpace, _
strUserID, _
strPassword)
'
' Note that Win32_OfflineFilesCache is a singleton.
'
' Also note that while we pass "False" for the bReplace parameter, that
' parameter is ignored. Existing destinations are never replaced, regardless
' of what we pass for the 3rd parameter.
'
Set objCache = objWMIServices.Get("Win32_OfflineFilesCache=@")
objCache.RenameItemEx strOldItemPath, strNewItemPath, False
If Err.Number <> 0 Then
WScript.Echo " RenameItemEx Failed:" &Err.Description
Err.Clear
On Error Resume Next
objCache.RenameItem strOldItemPath, strNewItemPath, False
If Err.Number <> 0 Then
WScript.Echo "RenameItem Failed:" &Err.Description
Err.Clear
Else
WScript.Echo "item rename scheduled. A restart of the system is necessary to apply the change."
End If
Else
WScript.Echo "item renamed."
End If
976698
(http://support.microsoft.com/kb/976698/
)
You are unable to update the target location of offline file shares in the offline file client side cache without administrative permission
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684
(http://support.microsoft.com/kb/824684/
)
Description of the standard terminology that is used to describe Microsoft software updates
Additional file informationAdditional file information for Windows 7 and for Windows Server 2008 R2Additional files for all supported x86-based versions of Windows 7Collapse this table
Additional files for all supported x64-based versions of Windows 7 and of Windows Server 2008 R2Collapse this table
Additional files for all supported IA-64-based versions of Windows Server 2008 R2Collapse this table
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
