Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

how to copy files to the current user profile upon logon

$
0
0

Hello, 

I'm trying to create a powershell script that will execute upon a user logging into the machine.  What the script will do is copy the C:\users\default\desktop\ directory and create/replace the identical/missing items in the target directory, which is their user profile.

In windows command line the command I had written was this

copy c:\users\default\desktop\* %profile%\desktop

I've tried using the command

Copy-item C:\users\default\desktop\* %profile%\desktop -recurse but it seems the %profile% reference does not work with powershell. Can someone please provide me with the correct syntax of the equivalent powershell command to my command line example?


Viewing all articles
Browse latest Browse all 6937

Trending Articles