Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ef8e434
1. add vdd install and uninstall shell bat.
DeleteElf Oct 24, 2025
43c5ac0
1. add vdd install and uninstall shell bat.
DeleteElf Oct 27, 2025
97749b4
1. repair file coding
DeleteElf Feb 12, 2026
3a7ec5e
Merge remote-tracking branch 'origin/master' into dev-master
DeleteElf Feb 12, 2026
92a0d65
1. update install scripts.
DeleteElf Feb 12, 2026
baa5a58
1. update install scripts.
DeleteElf Feb 12, 2026
2e1af84
Merge remote-tracking branch 'origin/master'
DeleteElf Feb 12, 2026
e3a74ce
Merge remote-tracking branch 'origin/dev-master'
DeleteElf Feb 12, 2026
80ebe28
1. revert README.md
DeleteElf Feb 12, 2026
eff5a72
1. revert
DeleteElf Feb 13, 2026
f5087d6
Merge branch 'VirtualDrivers:master' into master
DeleteElf May 28, 2026
1b68aa2
1. 虚拟驱动管理去掉了安装和卸载逻辑
DeleteElf Jun 2, 2026
8ad24b3
1. 全面去掉了devcon的支持。
DeleteElf Jun 2, 2026
20bb945
1. 内置了对应版本的netcon
DeleteElf Jun 2, 2026
eba5a8a
1. 修复错误
DeleteElf Jun 2, 2026
f1efc3a
1. 去掉多余的空行
DeleteElf Jun 2, 2026
a64ac93
Merge remote-tracking branch 'origin/dev-master'
DeleteElf Jun 3, 2026
1344be4
1. update changelog
DeleteElf Jun 3, 2026
0450688
Merge remote-tracking branch 'origin/dev-master'
DeleteElf Jun 3, 2026
7fddd66
1. 修正虚拟显示器每个产品型号都一样的问题
DeleteElf Jun 3, 2026
7bc1ff6
1. 修正虚拟显示器每个产品型号都一样的问题
DeleteElf Jun 3, 2026
5aed11a
1. 去掉没用的解决方案文件
DeleteElf Jun 23, 2026
4580ee9
1. 优化虚拟显示器
DeleteElf Jun 23, 2026
4d120f3
1. 完善IddCxVersionQuery,使其支持命令行执行pipe
DeleteElf Jul 10, 2026
39898bb
脚本升级优化。
DeleteElf Jul 10, 2026
938a17f
新增显示驱动官方开发文档。
DeleteElf Jul 10, 2026
28a32fd
新增显示驱动官方开发文档。
DeleteElf Jul 10, 2026
7df594c
新增显示驱动官方开发文档。
DeleteElf Jul 10, 2026
7a864ec
整合代码
DeleteElf Jul 10, 2026
ca6d084
整合代码
DeleteElf Jul 10, 2026
e3dd1b7
完成初步整合并生成成功
DeleteElf Jul 10, 2026
2de18b4
完成初步整合并生成成功
DeleteElf Jul 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ bld/

# Visual Studio 2015 cache/options directory
.vs/
.idea/
.vscode/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

Expand Down
34 changes: 16 additions & 18 deletions Community Scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Scripts
#Scripts

This is a collection of Powershell scripts, written during the whole driver development. PR's are welcome for improvements or other/more functions. There haven't been a focus on keeping the scripts "up to date" all the time. Which means changes that might have occurred in the modules that these scripts depend upon, haven't been corrected either. These are more ment as a framework for "tinkers" to make use of Powershell to change settings on the fly. To use these, you should be at least be comfortable with Powershell and understand Admin privilegiets, risk/reward.
这是一组在驱动开发过程中编写的PowerShell脚本集。欢迎提出改进意见或新增其他功能。我们并未始终专注于保持脚本的"时效性",这意味着这些脚本所依赖的模块可能发生的变更也未得到修正。它们更多是作为一个框架,供"实验者"利用PowerShell即时修改设置。使用这些脚本需至少熟悉PowerShell并理解管理员权限的风险与回报。

Anyway here is a short description of each script:
| Script | Description |
| ---------------------- | ---------------- |
| [changeres‑VDD.ps1](changeres-VDD.ps1) | Hot‑swaps the virtual panel’s resolution to the width and height you pass on the command line. |
| [get_disp_num.ps1](get_disp_num.ps1) | Returns the numeric adapter ID of the VDD screen by scanning WMI for your custom “MTT1337” monitor identifier. |
| [HDRswitch‑VDD.ps1](HDRswitch-VDD.ps1) | Flips the virtual screen between SDR (8‑bit) and HDR (10‑bit) colour modes in one click. Unsure if it works anylonger, since changes in modules |
| [modules_install.bat](modules_install.bat) | Opens an elevated PowerShell session that installs the DisplayConfig and MonitorConfig modules so every helper script has its prerequisites. |
| [primary‑VDD.ps1](primary-VDD.ps1) | Makes the virtual display the Windows primary so you can stream or remote‑desktop from a headless rig. |
| [refreshrate‑VDD.ps1](refreshrate.ps1) | Changes the VDD monitor’s refresh rate (30‑‑500 Hz) after validating the value against a safe list. |
| [rotate‑VDD.ps1](rotate-VDD.ps1) | Rotates the virtual display 90°, 180°, or 270° by calling DisplayConfig with the matching rotation token. |
| [scale‑VDD.ps1](scale-VDD.ps1) | Sets or resets DPI scaling on the virtual monitor, respecting Windows’ maximum allowed scale factor. |
| [set‑dependencies.ps1](set-dependencies.ps1) | Verifies the exact module versions required, installs or imports them on demand, and aborts downstream execution if anything is missing. |
| [silent‑install.ps1](silent-install.ps1) | Silently fetches the latest signed Virtual Display Driver from GitHub and installs it via Nefcon, then tidies up the temp workspace. |
| [toggle‑VDD.ps1](toggle-VDD.ps1) | A one‑click PowerShell switch that first elevates itself to admin, then enables or disables your Virtual Display Driver and immediately flips Windows between Extended and Cloned desktops, perfect for streamers who need to bring a virtual monitor online or offline on demand. |
| [virtual-driver-manager.ps1](virtual-driver-manager.ps1) | A comprehensive script to manage the Virtual Display Driver. It can install, uninstall, enable, disable, toggle, and check the status of the driver. |
| [winp‑VDD.ps1](winp-VDD.ps1) | A lightweight companion script that leaves the driver untouched and simply yo‑yos Windows between Extend and Clone modes, giving you an instant “presentation toggle” when the virtual display should stay permanently enabled. |
以下是每段脚本的简短说明:

silent‑install.ps1 – 静默地从GitHub获取最新的已签名虚拟显示驱动程序,通过DevCon进行安装,然后清理临时工作区。
modules_install.bat – 打开一个提升的PowerShell会话,该会话安装DisplayConfig和MonitorConfig模块,以便每个帮助脚本都有其先决条件。
set‑dependencies.ps1 – 验证所需的确切模块版本,按需安装或导入它们,如果缺少任何内容,则中止下游执行。
get_disp_num.ps1 – 通过扫描WMI以查找自定义的“MTT1337”监视器标识符,返回VDD屏幕的数字适配器ID。
changeres‑VDD.ps1 – 将虚拟面板的分辨率热交换为您在命令行上传递的宽度和高度。
refreshrate‑VDD.ps1 – 根据安全列表验证值后,更改VDD监视器的刷新率(30-500Hz)。
rotate‑VDD.ps1 – 将虚拟显示器旋转90°,180°,或270°通过使用匹配的旋转标记调用DisplayConfig。
scale‑VDD.ps1 – 在虚拟监视器上设置或重置DPI缩放,遵守Windows允许的最大缩放因子。
HDRswitch‑VDD.ps1 – 一键即可在SDR(8位)和HDR(10位)颜色模式之间翻转虚拟屏幕。不确定它是否还能继续工作,因为moduels发生了变化)
primary‑VDD.ps1 – 将虚拟显示器设置为Windows主显示器,以便您可以从无头设备流式传输或远程桌面。
toggle‑VDD.ps1 – 一键式PowerShell开关,首先将自身提升为管理员,然后启用或禁用您的虚拟显示驱动程序,并立即在扩展和克隆桌面之间翻转Windows,非常适合需要按需将虚拟显示器联机或脱机的流媒体用户。
winp‑VDD.ps1 – 一个轻量级的配套脚本,使驱动程序不受影响,只需在扩展和克隆模式之间切换窗口,在虚拟显示器应永久启用时为您提供即时的“演示切换”。
17 changes: 17 additions & 0 deletions Community Scripts/SetAutoLogin.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
chcp 65001

REM 设置允许自动登录
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" /v DevicePasswordLessBuildVersion /t REG_DWORD /d "0" /f

echo 在打开的窗口中 取消勾选‌ “要使用本机,用户必须输入用户名和密码” 选项 ,并点击 "应用"。

echo 系统会弹出“自动登录”窗口,输入你当前账户的‌完整密码‌(如果是微软账户,请输入邮箱绑定的密码,而非PIN码),然后点击 ‌“确定”‌。

echo 正在准备进入设置界面...

pause

netplwiz

pause
9 changes: 6 additions & 3 deletions Community Scripts/changeres-VDD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ param(
[int]$xres,
[Parameter(Mandatory, Position=1)]
[Alias("Y","VerticalResolution")]
[int]$yres
[int]$yres,
[Parameter(Mandatory, Position=2)]
[Alias("id","displayIndex")]
[int]$displayId
)

# Self-elevate the script if required
Expand All @@ -21,7 +24,7 @@ if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
. "$PSScriptRoot\set-dependencies.ps1"

# Getting the correct display
$disp = Get-DisplayInfo | Where-Object { $_.DisplayName -eq "VDD by MTT" }
#$disp = Get-DisplayInfo | Where-Object { $_.DisplayName -eq "VDD by MTT" }

# Setting the resolution on the display
Set-DisplayResolution -DisplayId $disp.DisplayId -Width $xres -Height $yres
Set-DisplayResolution -DisplayId $displayId -Width $xres -Height $yres
5 changes: 5 additions & 0 deletions Community Scripts/set-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ if (-not (Get-PSRepository -Name $repo.Name -ErrorAction SilentlyContinue)) {
Set-PSRepository -Name $repo.Name -InstallationPolicy Trusted `
-InformationAction Ignore -WarningAction SilentlyContinue

#import DisplayConfig
Import-Module DisplayConfig
#import MonitorConfig
Import-Module MonitorConfig

# Loop through the modules and ensure they are imported & installed
foreach ($m in $modules) {

Expand Down
101 changes: 63 additions & 38 deletions Community Scripts/silent-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,80 @@
param(
# Latest stable version of NefCon installer
[Parameter(Mandatory=$false)]
[string]$NefConURL = "https://github.com/nefarius/nefcon/releases/download/v1.14.0/nefcon_v1.14.0.zip",
[string]$NefConURL = "https://github.com/nefarius/nefcon/releases/download/v1.17.40/nefcon_v1.17.40.zip",

# Latest stable version of VDD driver only
[Parameter(Mandatory=$false)]
[string]$DriverURL = "https://github.com/VirtualDrivers/Virtual-Display-Driver/releases/download/25.7.23/VirtualDisplayDriver-x86.Driver.Only.zip"
);

# Create temp directory
$tempDir = Join-Path $env:TEMP "VDDInstall";
$tempDir = $PSScriptRoot;
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null;

# Download and unzip NefCon
Write-Host "Downloading and extracting NefCon..." -ForegroundColor Cyan;
$NefConZipPath = Join-Path $tempDir "nefcon.zip";
Invoke-WebRequest -Uri $NefConURL -OutFile $NefConZipPath -UseBasicParsing -ErrorAction Stop;
Expand-Archive -Path $NefConZipPath -DestinationPath $tempDir -Force -ErrorAction Stop;
$NefConExe = Join-Path $tempDir "x64\nefconw.exe";

# Download and unzip VDD
Write-Host "Downloading and extracting VDD..." -ForegroundColor Cyan;
$driverZipPath = Join-Path $tempDir 'driver.zip';
Invoke-WebRequest -Uri $DriverURL -OutFile $driverZipPath;
Expand-Archive -Path $driverZipPath -DestinationPath $tempDir -Force;
# Define path to nefcon executable
$NefConExe = Join-Path $tempDir "x64\nefconc.exe";
# Download and run DevCon Installer
if (-not (Test-Path $NefConExe))
{
$NefConZipPath = Join-Path $tempDir "nefcon.zip";
if (-not (Test-Path $NefConZipPath))
{
Write-Host "Downloading NefCon..." -ForegroundColor Cyan;
Invoke-WebRequest -Uri $NefConURL -OutFile $NefConZipPath -UseBasicParsing -ErrorAction Stop;
}
Write-Host "extracting NefCon..." -ForegroundColor Cyan;
Expand-Archive -Path $NefConZipPath -DestinationPath $tempDir -Force -ErrorAction Stop;
Write-Host "extracting NefCon Completed..." -ForegroundColor Cyan;
}

# Extract the SignPath certificates
Write-Host "Extracting SignPath certificates..." -ForegroundColor Cyan;
$catFile = Join-Path $tempDir 'VirtualDisplayDriver\mttvdd.cat';
$catBytes = [System.IO.File]::ReadAllBytes($catFile);
$certificates = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection;
$certificates.Import($catBytes);
# Check if VDD is installed. Or else, install it
$check = & $NefConExe --find-hwid ---hardware-id "Root\NztVdd";
if ($check -match "Virtual Display Driver") {
Write-Host "Virtual Display Driver already present. No installation." -ForegroundColor Green;
} else {
# Extract the signPath certificates
$catFile = Join-Path $tempDir 'VirtualDisplayDriver\NztVdd.cat';
if (-not (Test-Path $catFile)){
# Download and unzip VDD
$driverZipPath = Join-Path $tempDir 'driver.zip';
if (-not (Test-Path $driverZipPath))
{
Write-Host "Downloading VDD..." -ForegroundColor Cyan;
Invoke-WebRequest -Uri $DriverURL -OutFile $driverZipPath;
}
Expand-Archive -Path $driverZipPath -DestinationPath $tempDir -Force;
}

# Create the temp directory for certificates
$certsFolder = Join-Path $tempDir "ExportedCerts";
New-Item -ItemType Directory -Path $certsFolder -Force | Out-Null;
# Extract the SignPath certificates
Write-Host "Extracting SignPath certificates..." -ForegroundColor Cyan;
$signature = Get-AuthenticodeSignature -FilePath $catFile;
$catBytes = [System.IO.File]::ReadAllBytes($catFile);
$certificates = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection;
$certificates.Import($catBytes);

# Write and store the driver certificates on local machine
Write-Host "Installing driver certificates on local machine." -ForegroundColor Cyan;
foreach ($cert in $certificates) {
$certFilePath = Join-Path -Path $certsFolder -ChildPath "$($cert.Thumbprint).cer";
$cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert) | Set-Content -Path $certFilePath -Encoding Byte;
Import-Certificate -FilePath $certFilePath -CertStoreLocation "Cert:\LocalMachine\TrustedPublisher";
}
# Create the temp directory for certificates
$certsFolder = Join-Path $tempDir "VirtualDisplayDriver";
if (-not (Test-Path $certsFolder))
{
New-Item -ItemType Directory -Path $certsFolder -Force | Out-Null;
}
# Write and store the driver certificates on local machine
Write-Host "Installing driver certificates on local machine." -ForegroundColor Cyan;
foreach ($cert in $certificates) {
$certFilePath = Join-Path -Path $certsFolder -ChildPath "NztVdd.cer";
$cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert) | Set-Content -Path $certFilePath -Encoding Byte;
Import-Certificate -FilePath $certFilePath -CertStoreLocation "Cert:\LocalMachine\Root";
Import-Certificate -FilePath $certFilePath -CertStoreLocation "Cert:\LocalMachine\TrustedPublisher";
}

# Install VDD
Write-Host "Installing Virtual Display Driver silently..." -ForegroundColor Cyan;
Push-Location $tempDir;
& $NefConExe install .\VirtualDisplayDriver\MttVDD.inf "Root\MttVDD";
Start-Sleep -Seconds 10;
Pop-Location;
# Install VDD
Write-Host "Installing Virtual Display Driver silently..." -ForegroundColor Cyan;
Push-Location $tempDir;
& $NefConExe install .\VirtualDisplayDriver\NztVdd.inf "Root\NztVdd";
Start-Sleep -Seconds 2;
Pop-Location;

Write-Host "Driver installation completed." -ForegroundColor Green;
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue;
Write-Host "Driver installation completed." -ForegroundColor Green;
}
#Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue;
17 changes: 17 additions & 0 deletions Community Scripts/silent-uninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Run this script in a powershell with administrator rights (run as administrator)
[CmdletBinding()]
param(

);

# Create temp directory
$tempDir = $PSScriptRoot;
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null;
$NefConExe = Join-Path $tempDir "x64\nefconc.exe";
Push-Location $tempDir;
& $NefConExe remove "Root\NztVdd";
& $NefConExe --uninstall-driver --inf-path .\VirtualDisplayDriver\NztVdd.inf;
Write-Host "Driver installation removed." -ForegroundColor Green;
Start-Sleep -Seconds 2;
Pop-Location;

28 changes: 28 additions & 0 deletions Community Scripts/vdd-install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@echo off
chcp 65001

echo "正在安装虚拟显示器..."

REM 将我们的配置目录写入注册表
rem install
set "DRIVER_DIR=%~dp0VirtualDisplayDriver"
echo driver directory:%DRIVER_DIR%
rem Get root directory,current in the scripts directory.
for %%I in ("%~dp0\..\..") do set "ROOT_DIR=%%~fI"
set "CONFIG_DIR=%ROOT_DIR%\config"
set "VDD_CONFIG=%CONFIG_DIR%\option.txt"
echo driver config path: %VDD_CONFIG%
REM 总是从原始目录中拷贝配置到配置目录,不管是用于恢复还是备份,都是不错的选择
copy "%DRIVER_DIR%\option.txt" "%VDD_CONFIG%"
REM 因为默认读的是注册表配置的目录,我们需要将注册表的目录配置一下
reg add "HKLM\SOFTWARE\MikeTheTech\VirtualDisplayDriver" /v path /t REG_SZ /d "%CONFIG_DIR%" /f
REM 注册表设置允许远程RPC
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v AllowRemoteRPC /t REG_DWORD /d "1" /f

REM 安装具体的驱动
powershell.exe -ExecutionPolicy Bypass -File "%~dp0silent-install.ps1"

REM 初次安装后,还应设置成扩展这些显示器的显示模式
powershell -NoProfile -ExecutionPolicy Bypass -Command "& "C:\Windows\System32\DisplaySwitch.exe" /extend"

echo "虚拟显示器安装完成"
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
@echo off

:: Use PowerShell for elevation check and execution
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"$elevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator');" ^
"if (-not $elevated) {" ^
"$CommandLine = '-File \"' + $MyInvocation.MyCommand.Path + '\" ' + $MyInvocation.UnboundArguments;" ^
"Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine;" ^
"Exit" ^
"} else {" ^
"Install-Module -Name DisplayConfig -Scope AllUsers -Force -AllowClobber;" ^
"Install-Module -Name MonitorConfig -Scope AllUsers -Force -AllowClobber;" ^
"if ($?) {" ^
"Write-Output 'Modules installed successfully.'" ^
"} else {" ^
"Write-Output 'An error occurred while installing the modules.'" ^
"}" ^
"}"

pause
@echo off
chcp 65001

:: Use PowerShell for elevation check and execution
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"$elevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator');" ^
"if (-not $elevated) {" ^
"$CommandLine = '-File \"' + $MyInvocation.MyCommand.Path + '\" ' + $MyInvocation.UnboundArguments;" ^
"Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine;" ^
"Exit" ^
"} else {" ^
"Install-Module -Name DisplayConfig -Scope AllUsers -Force -AllowClobber;" ^
"Install-Module -Name MonitorConfig -Scope AllUsers -Force -AllowClobber;" ^
"if ($?) {" ^
"Write-Output 'Modules installed successfully.'" ^
"} else {" ^
"Write-Output 'An error occurred while installing the modules.'" ^
"}" ^
"}"
4 changes: 4 additions & 0 deletions Community Scripts/vdd-uninstall.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
chcp 65001

powershell.exe -ExecutionPolicy Bypass -File "%~dp0\silent-uninstall.ps1"
Loading