Skip to content

πŸ› Fix VBS launchers using bare pwsh.exe β€” recording never starts for dpuerner#92

Merged
J-MaFf merged 1 commit intomainfrom
fix/vbs-pwsh-full-path
Mar 27, 2026
Merged

πŸ› Fix VBS launchers using bare pwsh.exe β€” recording never starts for dpuerner#92
J-MaFf merged 1 commit intomainfrom
fix/vbs-pwsh-full-path

Conversation

@J-MaFf
Copy link
Copy Markdown
Owner

@J-MaFf J-MaFf commented Mar 27, 2026

What does this PR do?

Fixes a bug where the iKAT recording task starts successfully (exit code 0) but never produces a recording file or any log output for dpuerner.

Root cause: Both VBS launcher files called pwsh.exe by name only. When wscript.exe launches a process via WScript.Shell.Run, it resolves executables against the system PATH for that user's session. pwsh.exe is installed at C:\Program Files\PowerShell\7\pwsh.exe and while this is in the PATH for admin sessions, it was not resolving correctly when launched via wscript in dpuerner's RDS session β€” causing wscript to silently return 0 without ever starting PowerShell.

Fix: Replace pwsh.exe with the full absolute path "C:\Program Files\PowerShell\7\pwsh.exe" in both .vbs launchers.

Files changed:

  • Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs
  • Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs

Why are we doing this?

Discovered when manually testing by running Start-ScheduledTask -TaskName "iKAT-Record-Dina" while dpuerner was active β€” task reported success but no .ts file or debug.log entry was produced. A diagnostic task using the full pwsh path confirmed dpuerner's session and USERNAME were correct; the only issue was wscript failing to locate pwsh.exe by name.

How should this be tested?

  1. Pull on server: git pull
  2. Manually run: Start-ScheduledTask -TaskName "iKAT-Record-Dina" (while dpuerner is logged on)
  3. Wait ~5 seconds β€” confirm a dpuerner_*.ts file appears in C:\Recordings and is growing
  4. Check C:\Recordings\debug.log for a Script started. USERNAME=dpuerner entry

Any deployment notes?

Pull on server β€” no task re-registration required since the tasks call the .vbs files by path, and the .vbs content is what changed.

Invoke-Command -Session $s { Set-Location C:\PowerShellScripts; git pull }

@J-MaFf J-MaFf added the bug Something isn't working label Mar 27, 2026
@J-MaFf J-MaFf self-assigned this Mar 27, 2026
@J-MaFf J-MaFf merged commit dc5b60e into main Mar 27, 2026
1 check failed
@J-MaFf J-MaFf deleted the fix/vbs-pwsh-full-path branch March 27, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant