WindowsAutostartApi 1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package WindowsAutostartApi --version 1.0.1
NuGet\Install-Package WindowsAutostartApi -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WindowsAutostartApi" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WindowsAutostartApi" Version="1.0.1" />
<PackageReference Include="WindowsAutostartApi" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WindowsAutostartApi --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WindowsAutostartApi, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WindowsAutostartApi@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WindowsAutostartApi&version=1.0.1
#tool nuget:?package=WindowsAutostartApi&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WindowsAutostartApi
Unified .NET API to manage Windows autostart entries:
- Registry:
HKCU/HKLM\Software\Microsoft\Windows\CurrentVersion\RunandRunOnce - Startup Folder: per-user and all-users (
.lnkshortcuts)
Target Framework: .NET 8 (net8.0-windows)
OS: Windows only
Features
- List all startup entries (Registry + Startup Folder)
- Add or update entries (idempotent)
- Remove entries
- Clean, extensible design (providers)
Install
dotnet add package WindowsAutostartApi
Quick Start
using WindowsAutostartApi;
var mgr = new StartupManager();
// Add HKCU\Run entry
mgr.Add(new StartupEntry(
Name: "MyCoolApp",
TargetPath: @"C:\Tools\MyCoolApp.exe",
Arguments: "--minimized",
Scope: StartupScope.CurrentUser,
Kind: StartupKind.Run));
// Add Startup Folder shortcut
mgr.Add(new StartupEntry(
Name: "MyCoolApp (Shortcut)",
TargetPath: @"C:\Tools\MyCoolApp.exe",
Arguments: "--tray",
Scope: StartupScope.CurrentUser,
Kind: StartupKind.StartupFolder));
// List
foreach (var e in mgr.ListAll())
Console.WriteLine($"{e.Scope} {e.Kind}: {e.Name} -> {e.TargetPath} {e.Arguments}");
// Remove
mgr.Remove("MyCoolApp", StartupScope.CurrentUser, StartupKind.Run);
mgr.Remove("MyCoolApp (Shortcut)", StartupScope.CurrentUser, StartupKind.StartupFolder);
API Surface
StartupEntry(string Name, string TargetPath, string? Arguments, StartupScope Scope, StartupKind Kind)StartupScope:CurrentUser,AllUsersStartupKind:Run,RunOnce,StartupFolderIStartupManager:IReadOnlyList<StartupEntry> ListAll()bool Exists(string name, StartupScope scope, StartupKind kind)void Add(StartupEntry entry)void Remove(string name, StartupScope scope, StartupKind kind)
Permissions
- HKCU: keine Admin-Rechte
- HKLM (AllUsers): ben�tigt Administratorrechte (UAC Elevation)
32/64-bit Notes
- Registry view defaults to 64-bit on 64-bit OS (
RegistryView.Registry64).
Demo Project
A small console demo is included under samples/WindowsAutostartApi.Demo, but it is skipped by default during solution builds.
Build/run it explicitly with:
dotnet run --project samples/WindowsAutostartApi.Demo -p:SkipBuild=false
Roadmap
- Optional Task Scheduler provider (Logon trigger, delay, highest privileges)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.