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?

link|improve this question
feedback

1 Answer

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

The RenameItem method you're interested in is here.

link|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
feedback

Your Answer

 
or
required, but never shown

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