Jump to content

MadMonk86

Member
  • Posts

    3
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by MadMonk86

  1. WOOHOO! Thanks VERY much and sorry for the late reply. I've been trying all the variations and things are working perfectly. It looks like all I missed on my initial try was a hyphen in front of "ItemType Directory". I still wish our vendor would write stuff to C:\ProgramData to make it profile-agnostic. Besides, who really shares machines any more?
  2. Thank you...the first portion is working for the specific need I had (a quick means to a quickly needed and specific end). I'm all for improving things, believe me, but my immediate need is copying a file to all known profiles to a path that does not yet exist...in other words create a folder/path in all profiles, then use the existing PS copy that I know works. Looking forward to seeing the rest of the improved script and thanks very much again!
  3. I have been using the following powershell script with perfect results (filenames and paths changed): $PathToMyFile = "MyFile.ext" $UserProfiles = GWmi Win32_UserProfile -filter "LocalPath Like '%\\Users\\%'" | Select-Object -ExpandProperty LocalPath ForEach ($Profile in $UserProfiles) { Copy-Item $PathToMyFile -Destination "$Profile\AppData\Roaming\folder\another_folder\data\stuff" } This copies a file to a specific location in each user profile on a machine. I need to expand this a bit to first CREATE a folder\path in each profile where it doesn't already exist, then copy a file as shown above. My powershell skills are non-existent and my failed attempt looked like this: $PathToMyFile = "MyFile.ext" $UserProfiles = GWmi Win32_UserProfile -filter "LocalPath Like '%\\Users\\%'" | Select-Object -ExpandProperty LocalPathForEach ($Profile in $UserProfiles) {New-Item "$Profile\AppData\folder\another_folder\stuff\data\config" ItemType directory}ForEach ($Profile in $UserProfiles) {Copy-Item $PathToMyFile -Destination "$Profile\AppData\folder\another_folder\stuff\data\config"} Can someone please take pity on a newbie and help? Of course if the software manufacturer would write their app so that it was profile-agnostic, that would help too!
×
×
  • Create New...