Access file through command line

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
TauMaster
Junior Member
Junior Member
Posts: 6
Joined: 2014-08-23, 20:09 UTC

Access file through command line

Post by *TauMaster »

I have this problem:
I copy the path of the file and paste it in command line. It tells me : File not found!
Why this happen!
How can i open the file by command line?
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

TC internal command line?
Ctrl+ArrowDown plus <Enter>







 
TauMaster
Junior Member
Junior Member
Posts: 6
Joined: 2014-08-23, 20:09 UTC

Exactly

Post by *TauMaster »

Thank you!
I will explain this in details.
In my office there is server, we have office chat and when a document come by e-mail, someone put the path of the document in the chat, so you can open it by copying the path and paste it in command line.
The others use FreeCommander and there is no problem with that. I like Total Commander much and when I put the path in my total commander command line, I get the message "File not found!" . Even if it is a file in my computer (for example in disk D), i have the same message. I cannot open the file from a command line at all. This bothers me.
I realize that if a filename have spacers in the name, total commander can't find it. If the name is without any spacers, it opened it. And if the filename have spacers and I put the whole path in "", it open it too? Why does it matter this spacers?
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Because Free Commander does that to convince (tenderfoot) user.
But it is not always good to be that smart and lie to your users. That way they will never learn.


With TC you can do such many different things that you exactly have to tell what you really want to do.

So if your path contains space, you have to quote them.
Even a leading quote is enough, BTW. Then TC knows what you want to do.



 
TauMaster
Junior Member
Junior Member
Posts: 6
Joined: 2014-08-23, 20:09 UTC

Yes!

Post by *TauMaster »

You're right, of course!
Have a nice evening and thank you again!
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

Stefan2 wrote:Because Free Commander does that to convince (tenderfoot) user.
But it is not always good to be that smart and lie to your users. That way they will never learn. 
Quite cocky, aren't we?
Not only implying that Free Commander users are unexperienced and need to learn,
but also assuming that this automatic behavior is worse than TC's semi-automatic.

The need to quote paths is a Windows requirement, due to ages old API and command line rules.
Assuming that it's better to suppress automatic quoting is shortsighted when it comes to productivity reasons.
I don't mind TC's current behavior, but not every user has the same expectations.

And BTW, tenderfoot = inexperienced.
Please spare the rare synonyms.
TC plugins: PCREsearch and RegXtract
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7024
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

milo1012 wrote: ...
Not only implying that Free Commander users are unexperienced and need to learn,
but also assuming that this automatic behavior is worse than TC's semi-automatic.
It is worse because it fails if you want to add more than one file name into the command line.
How can Free Commander know what the spaces between words mean ?
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

Horst.Epp wrote:How can Free Commander know what the spaces between words mean ?
Seriously?
Simply by checking if the first command parts reference an existing file/path.
If's the same if you'd have a file

Code: Select all

c:\dir1\the first file.exe
Open cmd.exe, go to dir1 and just type "t" and press the tabulator key.
When having more files with same name parts you'd check which one matches the command line the most and quote it.
I'm not sure if it's some API call or an autonomous algorithm, but it works.

Of course, if you would reference other files/paths with spaces later
in the command line you'd still have to quote them manually,
but for most simple or average use cases this will work.

I really wouldn't call that worse, since all following parameters stay untouched, but it already helps in cases like TauMaster's.
TC plugins: PCREsearch and RegXtract
Post Reply