Jump to content
Muxe Inc Forums
Sign in to follow this  
dandv

Win32 Command line mishandling on '(' parens

Recommended Posts

dandv    0

1. Create a file "doc(test).txt".

2. Drop the LFN to the command line by pressing Ctrl+Alt+Enter

3. Under Win2K, if you launch "doc(test).txt" at the command prompt, the application associated with .TXT (e.g. notepad) will launch.

However, in NDN you'll get an error from cmd.exe:

'doc' is not recognized as an internal or external command,
operable program or batch file.

It looks like NDN truncated the filename at the '('.

5. Not so fast. Move the file to a folder called "c:\my documents".

6. Drop to the command line the full-path LFN by pressing Ctrl+Alt+Shift+Enter: "C:\my documents\doc(test).txt"

7. Press Enter. The cmd.exe error will be

'C:\my' is not recognized as an internal or external command,
operable program or batch file.

So NDN didn't cut at the '(' but at the first space.

 

8. By the way, there is an inconsistency regarding LFN+Pathnames:

Ctrl+Alt+Shift+Enter copies to the command line the LFN+path

Ctrl+Alt+Shift+Insert copies to the clipboard the SHORTFN+SHORTpath.

 

I would propose that the Win32 NDN move the LFN shortcuts to the simpler key combinations and keep the SFN ones (in case they are ever needed) to the longer key combination.

 

The reason is simple: suppose you have a converter from filetype .ABC to filetype .XYZ. So you'll run

converter my_long_filename.ABC my_long_filename.XYZ

Now you'll have my_long_filename.ABC in the file panel so you'll drop it to the command line with Ctrl+Enter, which gets you the SFN: my_lon~1.ABC. This is still OK, because the converter will find the file anyway.

For the destination file, my_long_filename.XYZ, the simplest way to avoid typing it by hand would be to Ctrl+Enter again the .ABC file and just change the extension. But, Ctrl+Enter will get you the SFN, so you'll end up with

converter my_lon~1.ABC my_lon~1.XYZ

, which is NOT what you want because you'll get my_lon~1.XYZ instead of my_long_filename.XYZ.

 

So here's what I propose:

  • Ctrl+Enter => LFN
  • Ctrl+Shift+Enter => LongPath+LFN
  • Ctrl+Alt+Enter => SFN
  • Ctrl+Alt+Shift+Enter => ShortPath+SFN
The same would go for copying to clipboard (just replace Enter with Insert).

 

So basically, Shift toggles path output and Alt toggles SFN/LFN output.

What do you think?

 

By the way, with regard to your post about NDN not receiving sufficient attention, if we decide to make changes, let's make the while NDN still has a small user base, so only few people will need to adapt.

Share this post


Link to post
Share on other sites

hi!

 

cmdline -> to the list

 

SFN/LFN ->

hehe...

this time i got you ;)

 

OPTIONS/CONFIGURATION/LFN-SETUP

Show Long File Names in

[X] Column Titles *[X] Put In cmdline *

[X] Command Line [X] File Panel Info

[X] Work panels *[X] Put in clipboard*

[X] Disk Info panel [ ] Put in listfiles

 

** are the 2 options you should take a look at

 

i will enable the PUT IN CMDLINE option by default

 

regarding amount of users and NDN:

well, in THEORY this is a good idea :)

but, i won't stop doing changes even if a lot of users will complain about it if it is the right thing to do ;)

 

NDN will still grow and have bugs (unfortunately, but maybe not so much :P) in future

 

or maybe i should only release a new version every 3-6 months? :P

 

Stefan / AH

 

PS: new beta next week

Share this post


Link to post
Share on other sites

hi dan!

 

about the doc(test).txt thing

NDN starts all programs like this

%comspec% /C %cmdline%

 

do the following (in NT+)

 

cmd /?

and look for the help on the /C and /K command

it should explain the () problem

although i don't know why it does that

 

or look here

http://www.microsoft.com/resources/documen.../en-us/Cmd.mspx

 

haven't found an easy way to solve that

 

Stefan / AH

Share this post


Link to post
Share on other sites
dandv    0

Hi AH!

 

I think I found a way to solve the "doc(test).txt" problem.

 

So,

 

1. If in the NDN command line you type "doc(test).txt" you'll get an error about "doc" not being recognized.

2. If in a cmd.exe command prompt you type the same thing, "doc(test).txt" will be launched (not recognized) but no truncation due to '('.

 

3. If in NDN you double the quotes, i.e. ""doc(test).txt"", step 2. will happen.

 

Does that help?

Dan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×