none
Set User Profile Picture with CMD RRS feed

Answers

  • unfortunately, I don't think you can dynamically reference a UNC path for the account picture.  If you look at where account pictures are stored, %appdata%\Roaming\Microsoft\Windows\AccountPictures, you will notice a weird file with a hex file name.  If you look at the properties of this file, you will notice that it has a specific type of Account Picture.  The file has no extension and cannot be opened by normal image editors--Photoshop won't even open it.

    The information is stored in the registry under the key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AccountPicture.  The string value SourceId contains the hex file name.  If you manually change this SourceId to a path with a .JPG, .PNG, .BMP, it won't work (at least I could not get it to work).

    If you do find an answer, it would be nice to know.  I am surprised MSFT did not think to allow what you are asking; it would seem second nature to me.  However, with the path MSFT has taken as of late, I am actually not too surprised.  Good luck.

    Saturday, June 29, 2013 6:59 PM

All replies

  • Whats the goal?  Are you trying to set a company logo to all user profiles?  If so you can make a Group Policy change and then ensure the file "User.bmp" located at "%ProgramData%\Microsoft\User Account Pictures" is changed to the BMP of your company logo....this would affect all user pictures.

    Computer Configuration\Administrative Templates\Control Panel\User Accounts\Apply the default user logon picture to all users


    Be kind and Mark as Answer if I helped.


    • Edited by Chris DeCarlo Saturday, June 29, 2013 2:58 AM spelling
    Saturday, June 29, 2013 2:58 AM
  • Whats the goal?  Are you trying to set a company logo to all user profiles?  If so you can make a Group Policy change and then ensure the file "User.bmp" located at "%ProgramData%\Microsoft\User Account Pictures" is changed to the BMP of your company logo....this would affect all user pictures.

    Computer Configuration\Administrative Templates\Control Panel\User Accounts\Apply the default user logon picture to all users


    Be kind and Mark as Answer if I helped.



    As I mentioned in my first post, it depends on the user logged on, look at the path ended with %USERNAME% which is an environment variable that filled with the user logged on.
    Saturday, June 29, 2013 3:06 AM
  • unfortunately, I don't think you can dynamically reference a UNC path for the account picture.  If you look at where account pictures are stored, %appdata%\Roaming\Microsoft\Windows\AccountPictures, you will notice a weird file with a hex file name.  If you look at the properties of this file, you will notice that it has a specific type of Account Picture.  The file has no extension and cannot be opened by normal image editors--Photoshop won't even open it.

    The information is stored in the registry under the key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AccountPicture.  The string value SourceId contains the hex file name.  If you manually change this SourceId to a path with a .JPG, .PNG, .BMP, it won't work (at least I could not get it to work).

    If you do find an answer, it would be nice to know.  I am surprised MSFT did not think to allow what you are asking; it would seem second nature to me.  However, with the path MSFT has taken as of late, I am actually not too surprised.  Good luck.

    Saturday, June 29, 2013 6:59 PM
  • Anyone?    A bug report at least?  Administrators need easy ways to set these things...
    Sunday, December 29, 2013 6:49 PM
  • I know in windows 7 if you make your logo a 128x128 BMP file and save it as user.bmp and guest.bmp in C:\ProgramData\Microsoft\User Account Pictures, all users that log in get the logo  

    this worked for me on 100 + windows 7 pc's on a 2008 Domain

    I automated the deployment to all the pc's by making a batch file, and added to my logon script, and set to only allow batch file to run once

    here is the simple batch file i used to do it ..

    REM set logon logo
    REM by scot a dumb geek
    REM — 
    REM — get to working directory
    c:\
    cd\
    cd ProgramData
    cd Microsoft
    cd "User Account Pictures"
    REM — get logo
    copy \\server2008\public_share\logo.bmp
    REM — back up go images
    copy guest.bmp guest.bmp.og
    copy user.bmp user.bmp.og
    REM — remove images
    del guest.bmp
    del user.bmp
    REM — make new images
    copy logo.bmp user.bmp
    copy logo.bmp guest.bmp
    

    should work in 8, just starting to deploy 8 in the network, and will see if this works still
    Friday, January 24, 2014 4:36 AM
  • Hi,

    The "accountpicture-ms" file format seems easy to build (header + img96x96 + header + img448x448), but if i take an already existing file of this format and if i want to affect this picture to a user by setting the value :

    "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AccountPicture\SourceId" 

    It does not work, the picture is not taken, do you know why  ?

    Thank you

    KoXo

    Sunday, April 13, 2014 2:25 PM
  • Hi

    I have been struggling with the same problem for a couple of days now. I thought I had it figured out by creating an "accountpicture-ms" file on my own computer and coping it to %appdata%\Microsoft\Windows\AccountPictures and set the value of the file in: "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AccountPicture\SourceId" but as it is already stated above that does not do it.

    After doing some registry monitoring when clicking on the "accountpicture-ms" file, that does set the profile picture correct, I noticed some activity in a hidden folder named: C:\Users\Public\AccountPictures\S-1-5-21-933334596-4129812972-2891473731-1001 (The last part of this dir should be changed with the unique GUID you got for your user)

    In that folder I found 5 versions of my profile pictures in jpg format, that is created when setting the profile pictures.

    The Operation does also set 5 Registry Keys here:

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AccountPicture\Users\5-21-933334596-4129812972-2891473731-1001\

    The keys are:

    • Image40
    • Image96
    • Image200
    • Image240
    • Image448

    The keys are pointing to the 5 jpg files mentioned above. I have not yet tested if this does the trick, but I will post my script here, if I get it to work..!


    Thomas | MCP | http://www.techwork.dk


    Friday, October 31, 2014 10:49 AM
  • Thomas, Did you ever get your script to work? I am having trouble with setting this in Windows 10. I just want to setup two user profiles with unique account pictures. the files are in a local folder and the HKLM is pointing to the 5 files, but the account still shows blank


    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    Thursday, November 1, 2018 7:29 PM
  • Thomas, Did you ever get your script to work? I am having trouble with setting this in Windows 10. I just want to setup two user profiles with unique account pictures. the files are in a local folder and the HKLM is pointing to the 5 files, but the account still shows blank


    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    I did test the steps manually on a Win10 device and had success; but only in doing so manually.
    I'm working on a script to try and handle this, but some of the issues I keep running into permissions or similar.

    What I did determine is as follows :

    HKU Registry Keys
    \Software\Microsoft\Windows\CurrentVersion\AccountState

    \Software\Microsoft\Windows\CurrentVersion\AccountPicture

    \Software\Microsoft\Windows\CurrentVersion\AccountPicture\SourceId - The value of this key should point to the accountpicture.ms file located in the user's %AppData%\Roaming\Microsoft\Windows\AccountPictures directory.

    These HKLM Registry Keys are also needed :

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AccountPicture\Users\5-21-933334596-4129812972-2891473731-1001\

    The keys are:

    • Image40
    • Image96
    • Image200
    • Image240
    • Image448

    The value of these keys points to respective images contained in \Users\Public\AccountPictures\<User's SID>\ directory; these images are automatically created when an Account Profile Picture is set, so you will have to set the Account Picture on a profile at least once to obtain these images.

    As far as I have tested, the filenames actually do not matter; it is the file locations and the Registry Keys which determine if it is applied. Once the images are placed in the appropriate User and Public AccountPictures directories, create the Registry Keys mentioned under HKLM, HKCU / HKU, then run "gpupdate / force" and logoff and logon. You should now have a new profile picture.

    Friday, April 12, 2019 2:45 PM