FCU - overwriting symbolic links?

Joined
Aug 15, 2015
Messages
53
Reaction score
3
Finally updated both my PCs to FCU 1709 and they both came through at the same time, which is very unusual. Normally one updates well before the other. Not the reason I am posing.

My portable has a single 1Tb SSD split into 2 'drives' (400 + 600Gb each roughly). As a result the C: drive is starting to run out of space and is close to being full so I do everything possible to take the load onto the 'data' drive. I also run most of my important data on a NAS which is mirrored (2 x 6Tb, at the moment). As a result of using a portable which is not always on the network I have the important directories on the network mirrored on the D-drive. It took a while before I realized how to move the Windows 'Offline' storage onto the D-drive with help of Mr Google, of course, but the procedure is relatively simple although it is relatively involved and uses the powershell. For the record the procedure involves:-
  1. Creating an offline folder through the Sync Centre in Control Panel
  2. Creating a folder for the offline file cache. Something like D:\Offline
  3. enter the powershell with administrator privileges
  4. type the following: takeown /r /f C:\Windows\CSC.
  5. Open the Sync Center and go to Manage Offline Files.
  6. Click Disable Offline Files and restart the machine.
  7. once back on the PC reenter powershell, again with Admin privileges
  8. then issue the following commands:
  9. rd /s C:\Windows\CSC (having just been created it should be empty but you may need to use /r as well, recursive)
  10. mklink /J C:\Windows\CSC D:\Offline
  11. (or whatever your folder name is, but use quotes if you have at least one space in the name).
  12. Reopen sync centre and the Manage Offline Files window and Enable Offline Files.
  13. Restart the machine.
  14. Your Offline files should now be stored on the other drive with important space on the Windows drive freed up.
This worked well, other than for the occasional slow back-up and sync error appearing, at least until I did the FCU a week ago. When I rebooted after the update I realized that the update had reconnected my C-drive as the offline directory of choice and all the work I had been doing for a week had disappeared from my files. Fortunately it was only the symbolic link that had disappeared. So it was back into the procedure above. This time though a few changes in the command sequence. Lines 9 and 10 had changed for some reason that is not obvious (had FCU overwritten the powershell to a prior version, I wonder). It took a while to work out and it might have been quicker to have recreated the files I needed from scratch but it was a learning exercise.

Lines 9 and 10 become
  • remove-item –recurse C:\Windows\CSC and
  • new-Item –ItemType SymbolicLink –Path C:\Windows\CSC –Target D:\Offline
Now don't ask me why I was having problems with rd and mkdir but the latter just threw up a "command not known" error in the powershell as if the command had been deleted and rd wasn't able to recursively delete the original CSC directory. Anyway a little reading shows that the above commands are actually what rd and mkdir do at a lower level.

Start up the sync centre, enable offline files, reboot and lo and behold the files I had been working on reappeared (phew!).

Anybody any ideas why FCU might delete the symbolic link for C:Windows\CSC ? and why the commands in the powershell disappeared (but that might be another thread in the powershell area).
 

Regedit32

Moderator
Joined
Mar 4, 2016
Messages
3,609
Reaction score
1,140
Interesting observations there.

The alias for Remove-Item is still rd so far as I am aware, however you cannot simply remove a directory without recursion of its contents [ some of which may be hidden and protected operating system files ]. You also will need elevated privileges in some cases.

So far as the mklink goes this is now built-in to PowerShell hence the need to use the built-in commandlet New-Item and as you probably saw the ItemType allows you to choose from File, Directory, HardLink, SymbolicLink or Junction. When using the older method to call to mimic a Command Prompt Shell if I recall you would use something like: cmd /c mklink c:\path\to\symlink c:\target\file [ and use /d if it were a Directory ].

I've not had the need to play with this in recent times so cannot say for certain this is still an option in PowerShell, but using the built-in Commandlet is perfectly adequate.

After you've typed New-Item -ItemType just hit your TAB key to cycle through the available parameters to pass
 
Joined
Aug 15, 2015
Messages
53
Reaction score
3
Interesting observations there.

The alias for Remove-Item is still rd so far as I am aware, however you cannot simply remove a directory without ...
...
After you've typed New-Item -ItemType just hit your TAB key to cycle through the available parameters to pass

Thanks, I should have waited before posting. I just went back into the powershell and typed both rd and mkdir and they both returned a command specific error, ie command has reappeared. Anyway the alternatives remain if these don't work. Yes, the recursive delete is necessary to delete the files and directories as specified. It is a neat solution to transferring data directories away from a Windows specific drive allocated to C: and I suspect to other niceties like network drives but haven't tried this yet. Doing much work on/in Linux it is nice to see a set of unix similar commands working under Windows but then powershell is unix like. I haven't tried the TAB key but will do so.

I thought it worth posting the procedure even though it is effectively solved (other than the query about whether FCU did overwrite the symbolic link). Repeating that question - anybody seen similar behavior with FCU or any other update? Is it something I need to check each time I get a Windows 10 update? Thanks for the Like.
 

Regedit32

Moderator
Joined
Mar 4, 2016
Messages
3,609
Reaction score
1,140
When Microsoft open-sourced Monad / PowerShell it was a great decision.

The PowerShell community has added a lot to improve things.


I have not noticed the specific item you've mentioned but I did notice the PowerShell IDE became incredibly unstable with the Fall update, but seems to have settled down since the last Cumulative Update.

I'll be interested to see whether anyone else has comments pertaining to your specific question.
 
Joined
Aug 15, 2015
Messages
53
Reaction score
3
I left this as unsolved as I wanted to find out what happened when Windows 10 updated itself and whether it was necessary go through the same rigmarole to get a non-C-Drive directory working for offline folders.

Well I am glad I did as the lattest update zeroed out my D-Drive folder and it's back to using the C-Drive offline folder.

Microsoft, stop doing this! If I want a non-C-Drive offline folder then I want a non-C-Drive offline folder and I don't want to go through the same set of commands to get it working again EVERY TIME THE SYTEM UPDATES. Although I must admit I only just realised that t happened when I ran out of disc space on the C-Drive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top