Page 1 of 1

"The directory name is invalid" error

Posted: 25 Sep 2012 23:15
by DrBunsen
I've got a very handy registry hack that I wrote that allows me to make a command prompt almost anywhere I can browse to by right-clicking on a folder and choosing "Command Prompt". Unfortunately, it doesn't work when I do it on something like \\servername\sharename in XYplorer, though it works as expected with Windows Explorer and xplorer2. The registry entries are made from a .REG file called CommandPrompt.reg with the following entries:

[HKEY_CLASSES_ROOT\Folder\shell\Command_Prompt]
@="Command Prompt"

[HKEY_CLASSES_ROOT\Folder\shell\Command_Prompt\command]
@="cmd.exe /k cls & pushd %L & title Command Prompt & prompt $m$_$p$g"


With this enhancement I am to explore to \\servername\sharename (even if it's \\servername\c$) and then right-click on it and choose "Command Prompt", which would then give me a command prompt with the Z: drive (or last available drive letter if Z: is taken) mapped to \\servername\sharename, and then sitting on that newly mapped drive. VERY handy, and I use it dozens of times a week while administering my network. Feel free to use it yourself! Microsoft used to have a PowerToy version of this, but it never worked properly since it reacted differently based on whether the folder you right-click on is in the tree or pane.

In any case, this enhancement causes an error box to appear when attempted on a share name XYplorer, such as \\servername\sharename. It works properly if I choose a folder under the share. Meaning, if I right-click on \\servername\sharename\foldername and choose Command Prompt, I'll find myself in Z:\foldername (if Z: is available). I've tried it under 32bit Windows 7, and will be trying it soon under 64bit Windows 7.

Any hope for a fix? Thanks!


DrBunsen
Ray

Re: "The directory name is invalid" error

Posted: 25 Sep 2012 23:30
by highend
Works for me with \\servername\sharename paths under Win 7 x64 Ultimate...

Difference here:
HKLM\SOFTWARE\Classes\Directory\Background\shell\runas\command

Re: "The directory name is invalid" error

Posted: 26 Sep 2012 00:03
by DrBunsen
Interesting! I'll test some more to see if I can find a pattern.

Re: "The directory name is invalid" error

Posted: 26 Sep 2012 00:18
by DrBunsen
D'oh! I just found out that my reghackery isn't needed any more in Windows Vista on up. If you shift-right-click on a folder it'll give you a "Command Prompt here" option, and it functions properly (better than MS's old TweakUI tool), and it works properly in XYplorer.

Still I do find it a bit jarring that XYplorer reacts differently with in my edge-case scenario compared to WE or CompetitorX.

Re: "The directory name is invalid" error

Posted: 26 Sep 2012 00:23
by DrBunsen
Sorry, it's "Open command window here" on the menu. Plus, this new MS Windows way works properly with XYplorer, but not with xplorer2.