In system variables, ATOM_HOME is set to G:\DATA\Atom.atom. No problem here neither. Atom sees the directory and uses it normally.

In the “Path” variable, I’ve set C:\Program Files (Portable)\Atom\resources\cli, because both apm and atom command line resides there.

Now, if I open a command prompt (it points to C:\Windows\System32 by default) and type apm --help, I can see the command is executed and I have a list of possible parameters for apm. But, if I type atom --help, I get:

\Atom\resources\cli\…\atom.exe" -ArgumentList "–pid not expected.

Whatever I type, I get the same result. What could it be? Any help would be much appreciated. Not that I use the command line so often, but I would like to narrow down this issue.

I have tried something similar on my Windows7 machine on Atom V1.20 Beta7.

What you describe should work.
Do make sure that you have the following when it is the first entry:"C:\Program Files (Portable)\Atom\resources\cli";
Note the " and the ;characters.

Next… when you changed the environment variable (such as PATH), make sure you close the command prompt and re-open it again before testing. I have seen a mention somewhere that it might even be needed to log-out and log-in again… but of this I am not sure of.

Additional note ->

AlphaUMi:

\Atom\resources\cli\…\atom.exe -ArgumentList –pid not expected

Why is there a mention of exe in the quoted message?
The command in the "C:\Program Files (Portable)\Atom\resources\cli" directory is atom.cmd.

I will provide a screenshot of course, but let me answer to the two dan’s points first.

First one: no problem with " and ; - proof is that apm is recognized and executed.
Second one: as to why atom.exe, in the cli folder there is atom.cmd indeed, but if you inspect the content of the file, it is as follows:

@echo off
SET EXPECT_OUTPUT=
SET WAIT=
SET PSARGS=%*
FOR %%a IN (%*) DO (
IF /I "%%a"=="-f" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="--foreground" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="-h" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="--help" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="-t" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="--test" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="--benchmark" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="--benchmark-test" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="-v" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="--version" SET EXPECT_OUTPUT=YES
IF /I "%%a"=="-w" (
SET EXPECT_OUTPUT=YES
SET WAIT=YES
)
IF /I "%%a"=="--wait" (
SET EXPECT_OUTPUT=YES
SET WAIT=YES
)
)
IF "%EXPECT_OUTPUT%"=="YES" (
SET ELECTRON_ENABLE_LOGGING=YES
IF "%WAIT%"=="YES" (
powershell -noexit "Start-Process -FilePath \"%~dp0\..\..\atom.exe\" -ArgumentList \"--pid=$pid $env:PSARGS\" ; wait-event"
exit 0
) ELSE (
"%~dp0\..\..\atom.exe" %*
)
) ELSE (
"%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" %*
)

As you can see, there is a redirection to atom.exe inside the file, this is in my opinion the reason why the output shows atom.exe.

And here is the screenshot. Not that “non atteso” means “not expected” in my language (Italian).

Thank you both guys for your interest in my issue. What could it be???

The dirty way to get things up and running for the moment is to clear out the effected line. Replace powershell with rem powershell. Where rem is short for remark which means “comment this line out”. Effectively what it will do is that the “wait” attribute will cause the command to not run properly.

I have no other leads for the moment.
Could you please execute the following in your command prompt (cmd):

Thank you danPadric! After commenting that line out, I tried atom --help from the command line and got the list of parameters. As you said, it works. Really, your help has been very useful. I thank you so much.

And for what regards the “origin” of the error… future will tell. I will stay with the dirty comment-out at the moment.

Activate logging of opening Atom, because of --enable-electron-logging

Open Atom

The file myFile.js will be open from path C:\Work Files\.
Notice the ".
If the file / directory does not exist, a “pretend” file will open.
The “pretend” file will become a new “actual” file as soon as you press save in Atom.

4. The command prompt will stay open for as long as Atom is open.The command prompt will auto close as soon as Atom is closed.Remark: changed code to suit design intent

The command prompt will pause in powershell ‘mode’ until atom is closed.
The command prompt will remain open.

If this resolves you problem, please consider marking the title of this topic with [SOLVED].

Thank you and best regards.
- Dan Padric

Additional notes: (notes for myself)

Assumption: AlphaUMi’s version of powershell seems to
use see --pid a system attribute and fails to use it.

Assume: --pid is an attribute of the atom command.

--pid=$pid is the handling over of the process identity to the atom command?

How to hand over pid attribute without having powershell complain about it.

Why is this attribute is not mentioned in atom --help.

For what is the process identity of the atom.exe call needed by the call?

Above idea removes all mention of additional arguments.
This is however only speculation - I have no clue why you have this naughty behaviour.

BUT
I am not going to have my academical curiosity chew on your time more.
Best you keep the code change that comments out the line with rem.
Thank you for testing my suggestions… you have been a good sport.

One last note… just keep in mind that if you update your installation, you will have to replace the atom.cmd file each time you make such an update.

unfortunately, even your last change in that line doesn’t work.
Enough, I can live with the rem comment-out line at the moment.

One last thing.
Are you one of the devs? If not, shouldn’t they be warned about this? Since I used a “stock”, unmodified version of the file, probably I am not the only one with this issue… probably the fact is that a lot of users do not care using the command line and are not aware of the problem. Where can I report issues so that this one can be putted to the dev’s attention?
I assume that it’s something related to PowerShell v5 (Windows 10), since Windows 7 (which you are using) is not affected. Do you agree?

Are you one of the devs? If not, shouldn’t they be warned about this? Since I used a “stock”, unmodified version of the file, probably I am not the only one with this issue… probably the fact is that a lot of users do not care using the command line and are not aware of the problem. Where can I report issues so that this one can be putted to the dev’s attention?

I assume that it’s something related to PowerShell v5 (Windows 10), since Windows 7 (which you are using) is not affected. Do you agree?

Hello.

I am not an Atom developer…
When it comes to ‘this’ world I am an amateur - I program (mainly) Siemens PLCs, not PCs.
I am very sorry for mistakenly creating a false impression.

Is the version of your Powershell the only issue? …@DamnedScholar would have mentioned something earlier if it was. Your PC being set for non-english or some security/anti-virus configuration, could also be considered.

Maybe the proper people are not looking at this topic. Please consider making a bug report - if one is not already there. Probably best place would be here: https://github.com/atom/atom/issues.

Thank you for borrowing me some of your time.
I hope you well.
- Dan Padric

Is the version of your Powershell the only issue? …@DamnedScholar would have mentioned something earlier if it was.

Don’t count on it. I don’t know anything about Powershell commands. I’ve used it a couple of times to run Powershell-specific scripts, but I barely know anything about its actual features and I’ve already devoted part of my brain to knowledge about zsh for when I’m on Linux.