Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Copy-Item doesn’t seem to like .lnks

$
0
0

I need to wipe user’s desktops contents completely. That line was easy.

My plan was to copy the short cuts to recreate the shortcuts that should be there by simply copying them from a network location.

Copy-Item -Path domainnetlogonshortcuts -Destination c:usersuserdesktop

This seems to attempt my solution because it returns this error for every .lnk file (using a Word example):

Copy-Item : Illegal characters in path.

CategoryInfo : InvalidArgument: (Word Shortcut.lnk:FileInfo) [Copy-Item], ArgumentException

Should I try a different method or am I missing something obvious with my command?

submitted by /u/suphater
[link] [comments]

The post Copy-Item doesn’t seem to like .lnks appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles