Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting 2nd parameter of run command #262

Closed
fade2gray opened this issue Jul 17, 2024 · 3 comments
Closed

Error converting 2nd parameter of run command #262

fade2gray opened this issue Jul 17, 2024 · 3 comments

Comments

@fade2gray
Copy link
Contributor

V1:

Run,% "*RunAs " ComSpec " /c .\folder\foo.exe .\folder\bar.sys " foobar, A_ScriptDir, Hide

V2 (Converted):

Run("*RunAs " A_ComSpec " /c .\folder\foo.exe .\folder\bar.sys " foobar, "A_ScriptDir", "Hide")

V2 (Expected):

Run("*RunAs " A_ComSpec " /c .\folder\foo.exe .\folder\bar.sys " foobar, A_ScriptDir, "Hide")
@Banaanae
Copy link
Collaborator

Banaanae commented Jul 18, 2024

I'll need to look into this more, but it might be a larger issue than just Run 2nd param nope

@Banaanae Banaanae reopened this Jan 1, 2025
@Banaanae
Copy link
Collaborator

Banaanae commented Jan 1, 2025

Run second param does not accept double quotes, so it makes it hard to know if it's a variable or path, could do a check to see if path

@Banaanae
Copy link
Collaborator

Banaanae commented Jan 6, 2025

This seems to be converted correctly actually,
I tried all of below and noted where they opened to

Run, % ComSpec " /k echo A" ; WorkingDir
Run, % ComSpec " /k echo B", A_Temp ; WorkingDir
Run, % ComSpec " /k echo C", %A_Temp% ; Temp
Run, % ComSpec " /k echo D", % A_Temp ; Temp

I think your example works because A_WorkingDir defaults to A_ScriptDir, and since if when run 2nd param is omitted (or in this case invalid), it will default to A_WorkingDir, which results in expected behaviour (maybe this is why v2 is stricter :) )

@Banaanae Banaanae closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants