1

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?

1
  • John, did you ever solve the renaming of offline files caches? I'm trying to keep the offline files cache intact while changing the location of where the online content is stored. Nothing seems to work however. Trust me, I've searched everywhere and I only found this place where anyone actually tried to do the same. Oct 18, 2018 at 11:39

1 Answer 1

0

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

The RenameItem method you're interested in is here.

2
  • Thanks for this. Good to know, but I'm looking for a command line option really.
    – john
    Sep 20, 2011 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, 2011 at 2:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .