Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The reason I ask is that I have been researching how to rename items once an offline files target has been changed. It seems that so far there are two options:

  • CSCCMD.exe - Which appears to be a legacy utility from XP
  • WMI - The method I chose to go for as it seems more recent

I have been trying to do it in PowerShell with the following command, but keep getting errors. Perhaps you could help me debug it:

Invoke-WmiMethod -Class WIN32_OfflineFilesCache -Name RenameItem -ArgumentList ("\\server1\Share\john\", "\\server2\Documents\john\", $false)

I've been getting various errors, including COMException and DirectoryNotFoundException, though I think I have dealt with the latter.

That I have found, there doesn't seem to be a useful set of CMDlets or command-line tools to work with offline files. Am I over-complicating the situation by not using CSCCMD and is there a vlid reason why I have to go and find it on the web?

share|improve this question

Yet a third option would be using the C++ native API instead of WMI.

The RenameItem method you're interested in is here.

share|improve this answer
Thanks for this. Good to know, but I'm looking for a command line option really. – john Sep 20 '11 at 22:01
Sorry, that was unclear. This API can be accessed through Powershell if necessary. It's not easy, but it's an option. – pk. Sep 21 '11 at 2:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.