[GH #4] Folder Whitespace issue #4

Open
opened 2026-11-25 02:54:54 +00:00 by NZAntivist · 9 comments
NZAntivist commented 2026-11-25 02:54:54 +00:00 (Migrated from github.com)

Imported from Zettrox/ztrx. Originally posted by NZAntivist on 2026-11-25T02:08:14Z.


Have found that if the folder the game is contained in has whitespace (i.e Game 6), the script will fail to find the exe.

Error from Logs:
victory.exe : Error: reading G:\GTA
At G:\ztrx-main\ztrx-main\scripts\play.ps1:14 char:1

  • & $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Enco ...
  •   + CategoryInfo          : NotSpecified: (Error: reading G:\GTA:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    
    

Caused by:
The system cannot find the file specified. (os error 2)

Folder name is GTA 6 but script stops reading on the whitespace.

<!-- greyfinch-sync:Zettrox/ztrx:issue:6595511255 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4). Originally posted by [NZAntivist](https://github.com/NZAntivist) on 2026-11-25T02:08:14Z. --- Have found that if the folder the game is contained in has whitespace (i.e Game 6), the script will fail to find the exe. Error from Logs: victory.exe : Error: reading G:\GTA At G:\ztrx-main\ztrx-main\scripts\play.ps1:14 char:1 + & $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Enco ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Error: reading G:\GTA:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Caused by: The system cannot find the file specified. (os error 2) Folder name is GTA 6 but script stops reading on the whitespace.
NZAntivist commented 2026-11-25 02:54:57 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by NZAntivist on 2026-11-25T02:08:48Z.


Have solved by adding an underscore instead of a space, but just for clarity sake

<!-- greyfinch-sync:Zettrox/ztrx:comment:7150371233 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7150371233). Originally posted by [NZAntivist](https://github.com/NZAntivist) on 2026-11-25T02:08:48Z. --- Have solved by adding an underscore instead of a space, but just for clarity sake
Yoshi-233 commented 2026-11-25 02:54:57 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T02:51:10Z.


I checked where the argument boundary is on 90b529f with PowerShell 7.7.0 on Linux. I pointed the unchanged script's -Exe at a native program that prints its arguments. With -Game 'Game Folder/sample.exe', the child received exactly ["run", "Game Folder/sample.exe", "--execute"]. The executable, cache and data paths also contained spaces. Passing Game and Folder/sample.exe as two separate arguments instead produced a PowerShell parameter-binding error before the child started.

For a Windows comparison, it would help to see the exact invocation with the private part of the path replaced, preserving the quotes, and the PowerShell version. For example, if you launch it from PowerShell, try & .\scripts\play.ps1 -Game 'G:\Game Folder\sample.exe'. My Linux run confirms how the script forwards a single path argument; I haven't reproduced the Windows truncation in your log.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7151270373 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7151270373). Originally posted by [Yoshi-233](https://github.com/Yoshi-233) on 2026-11-25T02:51:10Z. --- I checked where the argument boundary is on `90b529f` with PowerShell 7.7.0 on Linux. I pointed the unchanged script's `-Exe` at a native program that prints its arguments. With `-Game 'Game Folder/sample.exe'`, the child received exactly `["run", "Game Folder/sample.exe", "--execute"]`. The executable, cache and data paths also contained spaces. Passing `Game` and `Folder/sample.exe` as two separate arguments instead produced a PowerShell parameter-binding error before the child started. For a Windows comparison, it would help to see the exact invocation with the private part of the path replaced, preserving the quotes, and the PowerShell version. For example, if you launch it from PowerShell, try `& .\scripts\play.ps1 -Game 'G:\Game Folder\sample.exe'`. My Linux run confirms how the script forwards a single path argument; I haven't reproduced the Windows truncation in your log.
NZAntivist commented 2026-11-25 03:06:40 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by NZAntivist on 2026-11-25T02:58:16Z.


Powershell Version is 5.1
The command was powershell -ExecutionPolicy Bypass -File scripts\play.ps1 -Game "G:\GTA 6\innerfolderwithnospaces\game_scarlett_master.exe"

as soon as I added an underscore between the A and the 6 it would launch no issues

<!-- greyfinch-sync:Zettrox/ztrx:comment:7151440139 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7151440139). Originally posted by [NZAntivist](https://github.com/NZAntivist) on 2026-11-25T02:58:16Z. --- Powershell Version is 5.1 The command was powershell -ExecutionPolicy Bypass -File scripts\play.ps1 -Game "G:\GTA 6\innerfolderwithnospaces\game_scarlett_master.exe" as soon as I added an underscore between the A and the 6 it would launch no issues
NZAntivist commented 2026-11-25 04:11:30 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by NZAntivist on 2026-11-25T03:14:23Z.


Updating Powershell to 7.7 has broken things further, using the command with the underscored folder now, I now get this output from Powershell and the attached log file:
& : The term '..\target\release\victory.exe' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At G:\ztrx-main\ztrx-main\scripts\play.ps1:14 char:3

  • & $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Enco ...
  • + CategoryInfo          : ObjectNotFound: (\..\target\release\victory.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    
    
    

ztrx.log

<!-- greyfinch-sync:Zettrox/ztrx:comment:7151724968 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7151724968). Originally posted by [NZAntivist](https://github.com/NZAntivist) on 2026-11-25T03:14:23Z. --- Updating Powershell to 7.7 has broken things further, using the command with the underscored folder now, I now get this output from Powershell and the attached log file: & : The term '\..\target\release\victory.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At G:\ztrx-main\ztrx-main\scripts\play.ps1:14 char:3 + & $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Enco ... + ~~~~ + CategoryInfo : ObjectNotFound: (\..\target\release\victory.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException [ztrx.log](https://github.com/user-attachments/files/35391220/ztrx.log)
Yoshi-233 commented 2026-11-25 04:11:31 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T03:21:28Z.


Thanks for posting the exact command and the follow-up. You already quoted the full -Game path correctly.

The two messages point to different steps. In the original report, victory.exe started and reported Error: reading G:\GTA. In the newer console output, PowerShell couldn’t find victory.exe itself. PR #17 addresses that default executable path. Also, if you reused the original powershell -File ... command after installing 7.7, Windows still starts PowerShell 5.1. The executable for PowerShell 7 is pwsh.exe.

Could you try this from the repo root in Windows PowerShell 5.1, where you first saw the space issue? It uses an intentionally missing file, so you can leave your working game folder exactly as it is.

$exe = (Resolve-Path .\target\release\victory.exe -ErrorAction Stop).Path
$probe = 'G:\ztrx path test\intentionally-missing.exe'

& $exe run $probe --execute
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\play.ps1 -Exe $exe -Game $probe
Select-String -LiteralPath "$env:TEMP\ztrx.log" -Pattern 'Error: reading' | Select-Object -First 1

A “file not found” error is expected. The useful part is the path after reading: does the direct run print the full G:\ztrx path test\intentionally-missing.exe? Does the script log print the same path, or just G:\ztrx? Those two lines are enough.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7151838451 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7151838451). Originally posted by [Yoshi-233](https://github.com/Yoshi-233) on 2026-11-25T03:21:28Z. --- Thanks for posting the exact command and the follow-up. You already quoted the full `-Game` path correctly. The two messages point to different steps. In the original report, `victory.exe` started and reported `Error: reading G:\GTA`. In the newer console output, PowerShell couldn’t find `victory.exe` itself. PR #17 addresses that default executable path. Also, if you reused the original `powershell -File ...` command after installing 7.7, Windows still starts PowerShell 5.1. The executable for PowerShell 7 is `pwsh.exe`. Could you try this from the repo root in **Windows PowerShell 5.1**, where you first saw the space issue? It uses an intentionally missing file, so you can leave your working game folder exactly as it is. ```powershell $exe = (Resolve-Path .\target\release\victory.exe -ErrorAction Stop).Path $probe = 'G:\ztrx path test\intentionally-missing.exe' & $exe run $probe --execute powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\play.ps1 -Exe $exe -Game $probe Select-String -LiteralPath "$env:TEMP\ztrx.log" -Pattern 'Error: reading' | Select-Object -First 1 ``` A “file not found” error is expected. The useful part is the path after `reading`: does the direct run print the full `G:\ztrx path test\intentionally-missing.exe`? Does the script log print the same path, or just `G:\ztrx`? Those two lines are enough.
NZAntivist commented 2026-11-25 04:11:31 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by NZAntivist on 2026-11-25T03:31:12Z.


Powershell Output:
Error: reading G:\ztrx path test\intentionally-missing.exe

Caused by:
The system cannot find the path specified. (os error 3)
PS G:\ztrx-main\ztrx-main> powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\play.ps1 -Exe $exe -Game $probe
Exited with 1; log: C:\Users\sddjn\AppData\Local\Temp\ztrx.log
PS G:\ztrx-main\ztrx-main> Select-String -LiteralPath "$env:TEMP\ztrx.log" -Pattern 'Error: reading' | Select-Object -First 1

log file attached

ztrx.log

<!-- greyfinch-sync:Zettrox/ztrx:comment:7151990130 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7151990130). Originally posted by [NZAntivist](https://github.com/NZAntivist) on 2026-11-25T03:31:12Z. --- Powershell Output: Error: reading G:\ztrx path test\intentionally-missing.exe Caused by: The system cannot find the path specified. (os error 3) PS G:\ztrx-main\ztrx-main> powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\play.ps1 -Exe $exe -Game $probe Exited with 1; log: C:\Users\sddjn\AppData\Local\Temp\ztrx.log PS G:\ztrx-main\ztrx-main> Select-String -LiteralPath "$env:TEMP\ztrx.log" -Pattern 'Error: reading' | Select-Object -First 1 log file attached [ztrx.log](https://github.com/user-attachments/files/35391693/ztrx.log)
Yoshi-233 commented 2026-11-25 04:11:31 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T03:36:01Z.


Thanks for running both commands. I checked the attached log: its first line contains the same full G:\ztrx path test\intentionally-missing.exe path as the direct run. The missing-file error was expected. That confirms the script preserved the spaces in this test with -Exe set explicitly. The original reading G:\GTA is still unexplained. If it happens again with the real path, the exact command and the first Error: reading ... line from that same run would help us compare.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7152065203 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7152065203). Originally posted by [Yoshi-233](https://github.com/Yoshi-233) on 2026-11-25T03:36:01Z. --- Thanks for running both commands. I checked the attached log: its first line contains the same full `G:\ztrx path test\intentionally-missing.exe` path as the direct run. The missing-file error was expected. That confirms the script preserved the spaces in this test with `-Exe` set explicitly. The original `reading G:\GTA` is still unexplained. If it happens again with the real path, the exact command and the first `Error: reading ...` line from that same run would help us compare.
ChackThree commented 2026-11-25 05:09:08 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by ChackThree on 2026-11-25T04:37:11Z.


Not sure if it will help. But I was having a similar issue.

X:\Misc\ztrx>powershell -ExecutionPolicy Bypass -File scripts\play.ps1 -Game "X:\Misc\GTA6.Xbox.v1.0.2.1-CYBERLEEK\game_scarlett_master.exe"
& : The term '\.\target\release\victory.exe' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At X:\Misc\ztrx\scripts\play.ps1:14 char:3
+ & $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Enco ...
+   ~~~~
    + CategoryInfo          : ObjectNotFound: (\.\target\release\victory.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Exited with ; log: C:\Users\user\AppData\Local\Temp\ztrx.log

Was lazy so I just fed it into AI and it created a modified play.ps1 script for me that launches with no issues.

# ztrx launcher: runs the game for normal play (no scripted presses, no capture).
param(
    [Parameter(Mandatory = $true)][string]$Game,
    [string]$Cache = "$env:LOCALAPPDATA\ztrx\cache",
    [string]$Data = "$env:LOCALAPPDATA\ztrx\data"
)

[string]$Exe = Join-Path $PSScriptRoot "..\target\release\victory.exe"

foreach ($v in "VICTORY_KEYS", "VICTORY_CAPTURE", "VICTORY_CAPTURE_FRAMES", "VICTORY_DUMP_TARGETS") {
    Remove-Item "Env:$v" -ErrorAction SilentlyContinue
}
New-Item -ItemType Directory -Force $Cache, $Data | Out-Null
$env:VICTORY_CACHE_DIR = $Cache
$env:VICTORY_DATA_DIR = $Data
& $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Encoding utf8
Write-Host "Exited with $LASTEXITCODE; log: $env:TEMP\ztrx.log"
<!-- greyfinch-sync:Zettrox/ztrx:comment:7153009672 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7153009672). Originally posted by [ChackThree](https://github.com/ChackThree) on 2026-11-25T04:37:11Z. --- Not sure if it will help. But I was having a similar issue. ``` X:\Misc\ztrx>powershell -ExecutionPolicy Bypass -File scripts\play.ps1 -Game "X:\Misc\GTA6.Xbox.v1.0.2.1-CYBERLEEK\game_scarlett_master.exe" & : The term '\.\target\release\victory.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At X:\Misc\ztrx\scripts\play.ps1:14 char:3 + & $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Enco ... + ~~~~ + CategoryInfo : ObjectNotFound: (\.\target\release\victory.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException Exited with ; log: C:\Users\user\AppData\Local\Temp\ztrx.log ``` Was lazy so I just fed it into AI and it created a modified ``play.ps1`` script for me that launches with no issues. ``` # ztrx launcher: runs the game for normal play (no scripted presses, no capture). param( [Parameter(Mandatory = $true)][string]$Game, [string]$Cache = "$env:LOCALAPPDATA\ztrx\cache", [string]$Data = "$env:LOCALAPPDATA\ztrx\data" ) [string]$Exe = Join-Path $PSScriptRoot "..\target\release\victory.exe" foreach ($v in "VICTORY_KEYS", "VICTORY_CAPTURE", "VICTORY_CAPTURE_FRAMES", "VICTORY_DUMP_TARGETS") { Remove-Item "Env:$v" -ErrorAction SilentlyContinue } New-Item -ItemType Directory -Force $Cache, $Data | Out-Null $env:VICTORY_CACHE_DIR = $Cache $env:VICTORY_DATA_DIR = $Data & $Exe run $Game --execute 2>&1 | Out-File "$env:TEMP\ztrx.log" -Encoding utf8 Write-Host "Exited with $LASTEXITCODE; log: $env:TEMP\ztrx.log" ```
Yoshi-233 commented 2026-11-25 06:06:46 +00:00 (Migrated from github.com)
Author

Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T05:39:28Z.


Thanks, @ChackThree. Moving the victory.exe path setup out of param() matches the fix in #17, which also keeps the -Exe override. Good to hear that change got the launcher working on your machine.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7154007573 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/issues/4#issuecomment-7154007573). Originally posted by [Yoshi-233](https://github.com/Yoshi-233) on 2026-11-25T05:39:28Z. --- Thanks, @ChackThree. Moving the `victory.exe` path setup out of `param()` matches the fix in #17, which also keeps the `-Exe` override. Good to hear that change got the launcher working on your machine.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Zettrox/ztrx#4
No description provided.