Unable to open a document from command line
Unable to open a document from command line
When I'm trying to open a document from command line, I receive an error message in Atlantis shown below.
Any solutions for this?
Any solutions for this?
- Attachments
-
- command.jpg (20 KiB) Viewed 10538 times
-
- result.jpg (10.42 KiB) Viewed 10538 times
If “test.docx” is located in “C:\Temp”, the proper command-line to open it in Atlantis would be:
Code: Select all
"D:\Users\<USER’S NAME>\PortableApps\Atlantis\awp.exe" "C:\Temp\test.docx"
I have just conducted a couple of tests. I am not sure that you can control the current directory of Atlantis by changing the console's current directory. Atlantis is not a console application. It seems that Windows automatically sets the executable's path as a current directory. So using full paths of document files within the command-line is preferable indeed.Csiga wrote:But instead of the current working directory, Atlantis tries to open the given file from the directory of the executable.
Yes, I have already figured this out. But if I want to open test.docx in wordpad, I just typeRobert wrote:If “test.docx” is located in “C:\Temp”, the proper command-line to open it in Atlantis would be:Code: Select all
"D:\Users\<USER’S NAME>\PortableApps\Atlantis\awp.exe" "C:\Temp\test.docx"
c:\temp>wordpad test.docx
and not
c:\temp>wordpad c:\temp\test.docx
Applications should check the CWD first, not the application's install directory imho.
Last edited by Csiga on Fri Apr 12, 2019 10:51 am, edited 1 time in total.
Command line
First, let me admit up front that I have a hard time following questions that people ask here. It is probably just my peculiar brain. So my apologies if I have missed the point entirely. Maybe what I am going to say is irrelevant to the issue under discussion here.
I am using the most recent version of Atlantis (3.2.13.4). Here is what I have found.
If I have a file 'infer.docx' in a subdirectory somewhere, like this:
C:\Users\rolan\Dropbox\Misc\infer.docx
If I want to use the command line (though why I do not know!), I can go to:
C:\Users\rolan\Dropbox\Misc>
and type 'awp infer.docx' at the prompt like this:
C:\Users\rolan\Dropbox\Misc> awp infer.docx
and hit ENTER ... I get an error.
However, if I put Atlantis on my PATH statement, things work fine. Just add:
C:\Program Files (x86)\Atlantis
at the end of your PATH statement.
Then you can open a file in Atlantis from any directory.
Again, maybe I misunderstood the issue.
EDITED TO ADD:
You can get a free Path manager here:
https://sourceforge.net/projects/pathtool/
It is easy to use. Just be sure to click the "Run as Administrator" button after you open the program, or it will not let you change anything, add or delete anything.
I am using the most recent version of Atlantis (3.2.13.4). Here is what I have found.
If I have a file 'infer.docx' in a subdirectory somewhere, like this:
C:\Users\rolan\Dropbox\Misc\infer.docx
If I want to use the command line (though why I do not know!), I can go to:
C:\Users\rolan\Dropbox\Misc>
and type 'awp infer.docx' at the prompt like this:
C:\Users\rolan\Dropbox\Misc> awp infer.docx
and hit ENTER ... I get an error.
However, if I put Atlantis on my PATH statement, things work fine. Just add:
C:\Program Files (x86)\Atlantis
at the end of your PATH statement.
Then you can open a file in Atlantis from any directory.
Again, maybe I misunderstood the issue.
EDITED TO ADD:
You can get a free Path manager here:
https://sourceforge.net/projects/pathtool/
It is easy to use. Just be sure to click the "Run as Administrator" button after you open the program, or it will not let you change anything, add or delete anything.
The command prompt utility does not know where “awp” or “awp.exe” might be located. The full path to “awp.exe” must be entered in the command-line:
C:\Program Files (x86)\Atlantis\awp.exe (long path)
C:\PROGRA~2\Atlantis\awp.exe (short path)
Let’s suppose that we have a document named “1b.docx” in “E:\TEMPZ”.
If we first type “CD /D E:\TEMPZ” to change the current directory to “E:\TEMPZ”, then press ENTER, we can launch the following command-line to open “1b.docx” in Wordpad:
E:\TEMPZ>"%ProgramFiles%\Windows NT\Accessories\wordpad.exe" 1b.docx
On the other hand, if we use the following command-line to open “1b.docx” in Atlantis:
E:\TEMPZ>"C:\Program Files (x86)\Atlantis\awp.exe" 1b.docx
We get a message from Atlantis saying that it could not open the following file:
C:\Users\<user’s name>\Documents\Atlantis\Documents\1b.docx
It seems that Atlantis is automatically looking for the target file in its own dedicated “Documents” folder. The current directory is simply ignored. To get Atlantis to open that file, we need to specify the location of the target file:
E:\TEMPZ>"C:\Program Files (x86)\Atlantis\awp.exe" E:\TEMPZ\1b.docx
C:\Program Files (x86)\Atlantis\awp.exe (long path)
C:\PROGRA~2\Atlantis\awp.exe (short path)
Let’s suppose that we have a document named “1b.docx” in “E:\TEMPZ”.
If we first type “CD /D E:\TEMPZ” to change the current directory to “E:\TEMPZ”, then press ENTER, we can launch the following command-line to open “1b.docx” in Wordpad:
E:\TEMPZ>"%ProgramFiles%\Windows NT\Accessories\wordpad.exe" 1b.docx
On the other hand, if we use the following command-line to open “1b.docx” in Atlantis:
E:\TEMPZ>"C:\Program Files (x86)\Atlantis\awp.exe" 1b.docx
We get a message from Atlantis saying that it could not open the following file:
C:\Users\<user’s name>\Documents\Atlantis\Documents\1b.docx
It seems that Atlantis is automatically looking for the target file in its own dedicated “Documents” folder. The current directory is simply ignored. To get Atlantis to open that file, we need to specify the location of the target file:
E:\TEMPZ>"C:\Program Files (x86)\Atlantis\awp.exe" E:\TEMPZ\1b.docx
Answer to admin
If I want to use the command line, I can go to:
However, if I put Atlantis on my PATH statement, things work fine. Just add:
C:\Program Files (x86)\Atlantis
at the end of your PATH statement.
Then you can open a file in Atlantis from any directory. You do not have to provide a path to the target file.
The error that I get is from Windows.C:\Users\rolan\Dropbox\Misc>
and type 'awp infer.docx' at the prompt like this:
C:\Users\rolan\Dropbox\Misc> awp infer.docx
and hit ENTER ... I get an error.
However, if I put Atlantis on my PATH statement, things work fine. Just add:
C:\Program Files (x86)\Atlantis
at the end of your PATH statement.
Then you can open a file in Atlantis from any directory. You do not have to provide a path to the target file.
I have added the Atlantis home folder to my current PATH environment variable. It now reads as follows:
PATH=C:\PROGRA~2\Atlantis;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\Administrateur\AppData\Local\Microsoft\WindowsApps
If I change the current directory to E:\TEMPZ, I can open Atlantis through the following command-line:
E:\TEMPZ>awp
However, if I add a target file like this:
E:\TEMPZ>awp 1b.docx
Atlantis is launched but it pops a message up saying that it could not open the following file:
C:\Users\<user’s name>\Documents\Atlantis\Documents\1b.docx
On my system at least, placing the Atlantis folder in the PATH is not enough to open a target file located outside the current search PATH variable.
Atlantis has to be given a clue as to which is the current (DOS) directory. This is done through the “%CD% environment variable. So the command-line to open “1b.docx” from the current directory is:
E:\TEMPZ>awp %CD%/1b.docx
The above command-line assumes that E:\TEMPZ is the current directory, and that the path to the Atlantis executable is included in the global PATH environment variable.
HTH.
Robert
PATH=C:\PROGRA~2\Atlantis;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\Administrateur\AppData\Local\Microsoft\WindowsApps
If I change the current directory to E:\TEMPZ, I can open Atlantis through the following command-line:
E:\TEMPZ>awp
However, if I add a target file like this:
E:\TEMPZ>awp 1b.docx
Atlantis is launched but it pops a message up saying that it could not open the following file:
C:\Users\<user’s name>\Documents\Atlantis\Documents\1b.docx
On my system at least, placing the Atlantis folder in the PATH is not enough to open a target file located outside the current search PATH variable.
Atlantis has to be given a clue as to which is the current (DOS) directory. This is done through the “%CD% environment variable. So the command-line to open “1b.docx” from the current directory is:
E:\TEMPZ>awp %CD%/1b.docx
The above command-line assumes that E:\TEMPZ is the current directory, and that the path to the Atlantis executable is included in the global PATH environment variable.
HTH.
Robert
Re: Command line
Kind of. You are talking about the availability of the awp executable. Yes, it has to be in the PATH to access it from everywhere in the file system.rstroud wrote:Maybe what I am going to say is irrelevant to the issue under discussion here.
The problem I created this thread is about the handling of the file name parameters given to the awp executable. By tradition the file name parameters without full path should be considered as being in the actual (working) directory. Awp.exe handled it differently and started searching the parameter file name in it's own directory.
A final comment
Whatever, dude.
I have been doing this for over 33 years, back to the DOS 2.11 days, and I understand how the PATH environmental variable works.
I have been doing this for over 33 years, back to the DOS 2.11 days, and I understand how the PATH environmental variable works.
Another final comment
I am debating whether even to post this, since I may be missing the point of what some of you are talking about.
But I will make a point before I leave this conversation. The following works just fine:
SITUATION
Atlantis is at the end of the PATH as follows:
C:\Program Files (x86)\Atlantis
I have a memory stick with a file called 5-Act.docx.
The .docx file is in Roland\Docs on the memory stick.
No copy of Atlantis is on the memory stick.
Memory stick is plugged into a port and designated as E: drive.
QUESTIONS
Will Atlantis open the file on E: if I change to the E:\ prompt?
Will Atlantis open the file without special parameters in the command?
ILLUSTRATION
The PATH
The COMMAND LINE Commands
RESULT
Atlantis opens the local file as designated in the simple DOS command.
NOTES
I conducted the test on one of my laptops, which uses Windows 7 Professional. Unfortunately, my Windows 10 desktop has all the USB ports in use.
I did not test this, but I wonder whether the use of the short expression for putting Atlantis on the Path
C:\PROGRA~2\Atlantis\awp.exe (short path)
makes a difference. I also did not include the 'awp.exe' in the Path; I just gave the direction to the Atlantis directory.
But I will make a point before I leave this conversation. The following works just fine:
SITUATION
Atlantis is at the end of the PATH as follows:
C:\Program Files (x86)\Atlantis
I have a memory stick with a file called 5-Act.docx.
The .docx file is in Roland\Docs on the memory stick.
No copy of Atlantis is on the memory stick.
Memory stick is plugged into a port and designated as E: drive.
QUESTIONS
Will Atlantis open the file on E: if I change to the E:\ prompt?
Will Atlantis open the file without special parameters in the command?
ILLUSTRATION
The PATH
The COMMAND LINE Commands
RESULT
Atlantis opens the local file as designated in the simple DOS command.
NOTES
I conducted the test on one of my laptops, which uses Windows 7 Professional. Unfortunately, my Windows 10 desktop has all the USB ports in use.
I did not test this, but I wonder whether the use of the short expression for putting Atlantis on the Path
C:\PROGRA~2\Atlantis\awp.exe (short path)
makes a difference. I also did not include the 'awp.exe' in the Path; I just gave the direction to the Atlantis directory.
This gave me quite a sweat but I think I got to the bottom of it.
Roland, you are right in every way, except that Atlantis will only open the target file if Atlantis.exe is not already running.
In other words, if one instance of Atlantis.exe is already running, and I use awp 1b.docx on the command-line, I systematically get a message from Atlantis saying that it could not open the following file:
C:\Users\<user’s name>\Documents\Atlantis\Documents\1b.docx
However, if no instance of Atlantis.exe is running, and I use awp 1b.docx on the command-line, that file opens normally in Atlantis.
Windows (and Atlantis) work in mysterious ways!
Roland, you are right in every way, except that Atlantis will only open the target file if Atlantis.exe is not already running.
In other words, if one instance of Atlantis.exe is already running, and I use awp 1b.docx on the command-line, I systematically get a message from Atlantis saying that it could not open the following file:
C:\Users\<user’s name>\Documents\Atlantis\Documents\1b.docx
However, if no instance of Atlantis.exe is running, and I use awp 1b.docx on the command-line, that file opens normally in Atlantis.
Windows (and Atlantis) work in mysterious ways!