Simplify installation: C:\eDNC-Fix\, hardcoded defaults

- Install location: C:\eDNC-Fix\
- Watch folder: C:\Dnc_Files\Q (hardcoded)
- File filter: *.pun (hardcoded)
- Removed redundant parameters from installer
- Streamlined README

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-12 08:43:42 -05:00
parent afad8e0c56
commit 2af9a9c558
2 changed files with 29 additions and 79 deletions

View File

@@ -10,22 +10,14 @@
- Runs whether user is logged on or not - Runs whether user is logged on or not
- Automatically restarts if it stops - Automatically restarts if it stops
.PARAMETER WatchFolder Monitors: C:\Dnc_Files\Q for *.pun files
The folder to monitor. Default: C:\Dnc_Files\Q
.PARAMETER FileFilter
File pattern to watch. Default: *.pun
.PARAMETER Uninstall .PARAMETER Uninstall
Remove the scheduled task instead of installing. Remove the scheduled task instead of installing.
.EXAMPLE .EXAMPLE
.\Install-ScheduledTask.ps1 .\Install-ScheduledTask.ps1
Installs with default settings Installs the scheduled task
.EXAMPLE
.\Install-ScheduledTask.ps1 -WatchFolder "D:\DNC\Programs" -FileFilter "*.nc"
Installs with custom folder and filter
.EXAMPLE .EXAMPLE
.\Install-ScheduledTask.ps1 -Uninstall .\Install-ScheduledTask.ps1 -Uninstall
@@ -33,8 +25,6 @@
#> #>
param( param(
[string]$WatchFolder = "C:\Dnc_Files\Q",
[string]$FileFilter = "*.pun",
[switch]$Uninstall [switch]$Uninstall
) )
@@ -60,8 +50,8 @@ Write-Host "========================================================" -Foregroun
Write-Host "" Write-Host ""
Write-Host " Task Name: $TaskName" Write-Host " Task Name: $TaskName"
Write-Host " Script: $ScriptPath" Write-Host " Script: $ScriptPath"
Write-Host " Watch Folder: $WatchFolder" Write-Host " Watch Folder: C:\Dnc_Files\Q"
Write-Host " File Filter: $FileFilter" Write-Host " File Filter: *.pun"
Write-Host "" Write-Host ""
# Remove existing task if present # Remove existing task if present
@@ -72,7 +62,7 @@ if ($existingTask) {
} }
# Build the PowerShell command # Build the PowerShell command
$Arguments = "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$ScriptPath`" -WatchFolder `"$WatchFolder`" -FileFilter `"$FileFilter`"" $Arguments = "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$ScriptPath`""
# Create the scheduled task # Create the scheduled task
$Action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument $Arguments -WorkingDirectory $PSScriptRoot $Action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument $Arguments -WorkingDirectory $PSScriptRoot

View File

@@ -19,87 +19,47 @@ This utility monitors a folder for DNC files and automatically strips specified
## Installation ## Installation
1. Copy the project folder to your DNC workstation 1. Copy the project folder to `C:\eDNC-Fix\` on the DNC workstation
2. Edit `eDNC-SpecialCharFix.ps1` to set your watch folder (default: `C:\Dnc_Files\Q`) 2. Run `Install-ScheduledTask.ps1` as Administrator
3. Run `Run-eDNCFix.bat` - it will auto-elevate to Administrator
**Note:** The batch file automatically requests Administrator privileges via UAC prompt. ```
C:\eDNC-Fix\
├── eDNC-SpecialCharFix.ps1
├── Run-eDNCFix.bat
├── Install-ScheduledTask.ps1
└── README.md
```
### Run as Scheduled Task (Recommended) ### Install as Scheduled Task (Recommended)
For production use, install as a scheduled task that runs as SYSTEM with admin rights:
```powershell ```powershell
# Run as Administrator # Run as Administrator
.\Install-ScheduledTask.ps1 C:\eDNC-Fix\Install-ScheduledTask.ps1
# With custom settings
.\Install-ScheduledTask.ps1 -WatchFolder "D:\DNC\Programs" -FileFilter "*.nc"
# To remove # To remove
.\Install-ScheduledTask.ps1 -Uninstall C:\eDNC-Fix\Install-ScheduledTask.ps1 -Uninstall
``` ```
This creates a task that: The scheduled task:
- Starts at system boot (before any user logs in) - Starts at system boot (before any user logs in)
- Runs as SYSTEM with highest privileges - Runs as SYSTEM with highest privileges
- Auto-restarts if it crashes - Auto-restarts if it crashes
- Runs hidden (no console window) - Watches `C:\Dnc_Files\Q` for `*.pun` files
### Run at User Login (Alternative) ### Run Manually (Alternative)
To run when a specific user logs in: Double-click `Run-eDNCFix.bat` - it will auto-elevate to Administrator via UAC.
1. Press `Win + R`, type `shell:startup`, press Enter ## Configuration
2. Create a shortcut to `Run-eDNCFix.bat` in the Startup folder
## Usage Default settings (edit `eDNC-SpecialCharFix.ps1` to change):
### Basic Usage | Setting | Default | Description |
|---------|---------|-------------|
Double-click `Run-eDNCFix.bat` or run from PowerShell: | WatchFolder | `C:\Dnc_Files\Q` | Folder to monitor |
| FileFilter | `*.pun` | File pattern to watch |
```powershell | IncludeSubfolders | `$true` | Watch subdirectories |
.\eDNC-SpecialCharFix.ps1 | CharactersToRemove | `@(255)` | Byte values to strip (0xFF) |
```
### Custom Watch Folder
```powershell
.\eDNC-SpecialCharFix.ps1 -WatchFolder "D:\DNC\Programs"
```
### Different File Types
```powershell
.\eDNC-SpecialCharFix.ps1 -FileFilter "*.nc"
```
### Remove Additional Characters
```powershell
# Remove 0xFF, NULL, and SUB characters
.\eDNC-SpecialCharFix.ps1 -CharactersToRemove @(255, 0, 26)
```
### All Options
```powershell
.\eDNC-SpecialCharFix.ps1 `
-WatchFolder "C:\Dnc_Files\Q" `
-FileFilter "*.pun" `
-IncludeSubfolders $true `
-CharactersToRemove @(255)
```
## Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| WatchFolder | String | C:\Dnc_Files\Q | Folder to monitor |
| FileFilter | String | *.pun | File pattern to watch |
| IncludeSubfolders | Boolean | $true | Watch subdirectories |
| CharactersToRemove | Int[] | @(255) | Byte values to strip |
## Output ## Output