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

Windows Command Prompt AutoRun should be avoided #114

Open
ADTC opened this issue Aug 16, 2022 · 0 comments
Open

Windows Command Prompt AutoRun should be avoided #114

ADTC opened this issue Aug 16, 2022 · 0 comments

Comments

@ADTC
Copy link

ADTC commented Aug 16, 2022

If you check cmd /? you'll see that Command Prompt has a feature to automatically run something upon starting:

If /D was NOT specified on the command line, then when CMD.EXE starts, it
looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
either or both are present, they are executed first.

    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun

        and/or

    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

I make use of it to have it run a script, which contains a bunch of commands (over 20 lines). It's kinda like a .bashrc file (not really, but it serves a similar purpose for me).

I installed your Edge extension (from Microsoft Edge extensions store) called "Open in Firefox". The problem is, in your native client, when the "Path to the executable" is empty, it is doing something with the command prompt. For some odd reason, this is flashing a bunch of command windows in quick succession. They come one after the other, and each one disappears in milliseconds, but just long enough to catch the title. That's when I noticed that every window has a title that's a line from my AutoRun script. It looks like it's opening a window for each line in the script for some odd reason.

The problem can be resolved by manually filling in the "Path to the executable" field (even if it's the default installation):
image

Once that is saved, the native client appears to run this executable directly, without passing through some instances of Command Prompt.

But I thought that if the field is empty, it tries to execute %ProgramFiles(x86)%\\Mozilla Firefox\\firefox.exe directly. So it seemed odd that it executes something via cmd. Perhaps if you need to run cmd in this case, it can be done with the /D option to avoid the AutoRun script: cmd /D ...

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

1 participant