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
- Automatically restarts if it stops
.PARAMETER WatchFolder
The folder to monitor. Default: C:\Dnc_Files\Q
.PARAMETER FileFilter
File pattern to watch. Default: *.pun
Monitors: C:\Dnc_Files\Q for *.pun files
.PARAMETER Uninstall
Remove the scheduled task instead of installing.
.EXAMPLE
.\Install-ScheduledTask.ps1
Installs with default settings
.EXAMPLE
.\Install-ScheduledTask.ps1 -WatchFolder "D:\DNC\Programs" -FileFilter "*.nc"
Installs with custom folder and filter
Installs the scheduled task
.EXAMPLE
.\Install-ScheduledTask.ps1 -Uninstall
@@ -33,8 +25,6 @@
#>
param(
[string]$WatchFolder = "C:\Dnc_Files\Q",
[string]$FileFilter = "*.pun",
[switch]$Uninstall
)
@@ -60,8 +50,8 @@ Write-Host "========================================================" -Foregroun
Write-Host ""
Write-Host " Task Name: $TaskName"
Write-Host " Script: $ScriptPath"
Write-Host " Watch Folder: $WatchFolder"
Write-Host " File Filter: $FileFilter"
Write-Host " Watch Folder: C:\Dnc_Files\Q"
Write-Host " File Filter: *.pun"
Write-Host ""
# Remove existing task if present
@@ -72,7 +62,7 @@ if ($existingTask) {
}
# 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
$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
1. Copy the project folder to your DNC workstation
2. Edit `eDNC-SpecialCharFix.ps1` to set your watch folder (default: `C:\Dnc_Files\Q`)
3. Run `Run-eDNCFix.bat` - it will auto-elevate to Administrator
1. Copy the project folder to `C:\eDNC-Fix\` on the DNC workstation
2. Run `Install-ScheduledTask.ps1` as 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)
For production use, install as a scheduled task that runs as SYSTEM with admin rights:
### Install as Scheduled Task (Recommended)
```powershell
# Run as Administrator
.\Install-ScheduledTask.ps1
# With custom settings
.\Install-ScheduledTask.ps1 -WatchFolder "D:\DNC\Programs" -FileFilter "*.nc"
C:\eDNC-Fix\Install-ScheduledTask.ps1
# 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)
- Runs as SYSTEM with highest privileges
- 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
2. Create a shortcut to `Run-eDNCFix.bat` in the Startup folder
## Configuration
## Usage
Default settings (edit `eDNC-SpecialCharFix.ps1` to change):
### Basic Usage
Double-click `Run-eDNCFix.bat` or run from PowerShell:
```powershell
.\eDNC-SpecialCharFix.ps1
```
### 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 |
| Setting | Default | Description |
|---------|---------|-------------|
| WatchFolder | `C:\Dnc_Files\Q` | Folder to monitor |
| FileFilter | `*.pun` | File pattern to watch |
| IncludeSubfolders | `$true` | Watch subdirectories |
| CharactersToRemove | `@(255)` | Byte values to strip (0xFF) |
## Output