如何批量修改Windows 10中EDA套件所有EXE的兼容性模式与管理员权限?
Hey there! I totally get the pain of manually configuring hundreds of EXEs—let's fix this with both a quick manual method (for one-off files) and automated bulk solutions that'll save you hours of repetitive clicks.
If you ever need to tweak a single file later, here's how:
- Right-click the target
.exefile and select Properties - Switch to the Compatibility tab
- Check Run this program in compatibility mode for: and pick Windows 7 from the dropdown
- Check Run this program as an administrator
- Hit Apply then OK
This is where the real time-saver is—two reliable methods to handle your entire EDA suite folder tree.
PowerShell Script (Recommended)
This script will recursively scan every .exe in your EDA folder, set Windows 7 compatibility mode, and enable "Run as administrator" automatically.
Step-by-Step:
- Open PowerShell as Administrator (right-click Start Menu > Windows PowerShell (Admin))
- Copy-paste the script below, replacing
C:\Path\To\Your\EDA\Suitewith your actual EDA installation folder path:
# Define the root folder of your EDA suite $rootPath = "C:\Path\To\Your\EDA\Suite" # Get all EXE files in the folder and subfolders $exeFiles = Get-ChildItem -Path $rootPath -Filter "*.exe" -Recurse -File foreach ($exe in $exeFiles) { # Set Windows 7 compatibility mode via registry $compatRegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" if (-not (Test-Path $compatRegistryPath)) { New-Item -Path $compatRegistryPath -Force | Out-Null } Set-ItemProperty -Path $compatRegistryPath -Name $exe.FullName -Value "WIN7RTM" -Force # Enable "Run as administrator" flag $shell = New-Object -ComObject Shell.Application $fileFolder = $shell.Namespace($exe.DirectoryName) $fileItem = $fileFolder.ParseName($exe.Name) # Find and trigger the "Run as administrator" verb foreach ($verb in $fileItem.Verbs()) { if ($verb.Name -match "Run as administrator") { $verb.DoIt() Start-Sleep -Milliseconds 500 # Give the system time to apply the setting break } } } Write-Host "All EXEs configured successfully! 🎉"
- Press Enter to run the script.
Notes:
- The 500ms sleep ensures each file's setting applies properly—adjust it if you notice some files aren't configured correctly
- A small number of EXEs might prompt a confirmation dialog; just click "Yes" if it pops up
- Always test the script on a small subset of files first to make sure it works as expected
Alternative: Direct Registry Edit (For Compatibility Mode Only)
If you just need to set Windows 7 compatibility mode (and handle admin rights separately), you can directly populate the registry:
- Open Registry Editor as Administrator (type
regeditin Start Menu, right-click > Run as administrator) - Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers - For each EXE, create a new String Value with the full path to the EXE as the name, and set its value to
WIN7RTM - To automate this, you can export the keys once configured for a few files, then write a
.regfile to import all entries at once.
内容的提问来源于stack exchange,提问作者Mark McWired

