Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Change a User Tile with Setupcomplete.cmd


  • Please log in to reply
3 replies to this topic

#1
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,879 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Not for Windows 8
This is not default tile with $OEM$

Someone asked me if you could change the user tile using the xml. Nothing there unless you use oobe.xml
I prefer not to do that so I looked and came up with this

From http://joco.name/201...-user-tile-api/
Using his code compiled to exe
 

using System;
using System.Runtime.InteropServices;

namespace FejesJoco
{
class Program
{
[DllImport("shell32.dll", EntryPoint = "#262", CharSet = CharSet.Unicode, PreserveSig = false)]
public static extern void SetUserTile(string username, int whatever, string picpath);

[STAThread]
static void Main(string[] args)
{
SetUserTile(args[0], 0, args[1]);
}
}
}

Copy and paste the above code lines in notepad.
Save the file as UTF8 and with an extention of .cs
For example Tile_replace.cs and save it on desktop

Open a command prompt on whatever directory you saved the file
Compile the code with the following command from command prompt:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe Tile_replace.cs

 

EDIT:

Use latest .NET you have for this

C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe

You get a Tile_replace.exe I copy somewhere like DVD\sources\$OEM$\$1\Install
Copy the picture there also. .jpg or .png

Using DVD\sources\$OEM$\$$\setup\scripts\setupcomplete.cmd I do this
 

rem Change User Picture
CMD /C %systemdrive%\Install\Tile_replace.exe Maxxpsoft %systemdrive%\Install\Maxxpsoft.jpg

That's it. When login screen appears my Tile is set
Attached File  0413131136-00.jpg   32.64KB   11 downloads

I'll include the compiled exe and code here

Attached Files


Edited by maxXPsoft, 23 September 2014 - 06:23 PM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1


How to remove advertisement from MSFN

#2
tes-com

tes-com
  • Member
  • 1 posts
  • Joined 02-September 14
  • OS:Windows 8.1 x64
  • Country: Country Flag

i used this on a windows 7 sp1 system. But Always get the error that the Tile_replace.exe is not working anymore

 

can you help me ?



#3
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,879 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

i used this on a windows 7 sp1 system. But Always get the error that the Tile_replace.exe is not working anymore

 

can you help me ?

I update original post

 

Use latest .NET you have for this

C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe

 

works for me


Edited by maxXPsoft, 23 September 2014 - 06:23 PM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#4
MrJinje

MrJinje

    Toolâ„¢ Developer

  • Developer
  • 1,031 posts
  • Joined 14-October 09
  • OS:Server 2012R2
  • Country: Country Flag

Threw that p/invoke inside an add-type so you might not need an external.exe for this trick. 

Add-Type -Language CSharp -TypeDefinition @"

using System;
using System.Runtime.InteropServices;
 
namespace FejesJoco
{
    public class Program
    {
        [DllImport("shell32.dll", EntryPoint = "#262", CharSet = CharSet.Unicode, PreserveSig = false)]
        public static extern void SetUserTile(string username, int whatever, string picpath);
 
        [STAThread]
        public static void Main(string[] args)
        {
            SetUserTile(args[0], 0, args[1]);
        }
    }
}

"@


[FejesJoco.Program]::Main("Maxxpsoft" "%systemdrive%\Install\Maxxpsoft.jpg")



Edited by MrJinje, 23 September 2014 - 07:15 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users