Windows 7 offers the possibility to show small user account pictures, for example in the start menu or on the lock screen. Since there is no documented way of setting this picture programmatically here is a solution for developing a small application that can do this for you.
You’ll simply need Visual Studio – either with C# or Visual Basic support. You can get your free edition here: http://www.microsoft.com/visualstudio/express. Create a new console application, copy and paste the following source code an build the solution. The resulting application will be able to set the user account pictures for you.
C# source:
Visual Basic source:
Now run it on a command line, for example:
useraccountpicture.exe domain\username picturefilename.jpg
Please note that this will not affect the logon screen. Since windows cannot know which user will logon it cannot display a picture.
Thank you so much!
I had been looking for a way to do this for so long and had nearly given up hope on it. Very, very helpful.
simple if you know how to do it, but insanely difficult if you do not know where to start looking.
Thanks so much!
Thanks for this. Not only did it work perfectly, but I was also able to learn a little about Visual Studio so thanks for that too!
You’re welcome!
does this update the user account in active directory, or just the local machine instance?
No, it does not update any information on active directory. You can refer to http://www.normanbauer.com/2011/08/12/how-to-save-a-user-picture-in-active-directory-with-vbscript/ on how to update pictures in ad.