"The directory name is invalid" error

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
DrBunsen
Posts: 5
Joined: 24 Sep 2012 22:06
Location: Fate, Texas

"The directory name is invalid" error

Post 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

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: "The directory name is invalid" error

Post by highend »

Works for me with \\servername\sharename paths under Win 7 x64 Ultimate...

Difference here:
HKLM\SOFTWARE\Classes\Directory\Background\shell\runas\command
One of my scripts helped you out? Please donate via Paypal

DrBunsen
Posts: 5
Joined: 24 Sep 2012 22:06
Location: Fate, Texas

Re: "The directory name is invalid" error

Post by DrBunsen »

Interesting! I'll test some more to see if I can find a pattern.

DrBunsen
Posts: 5
Joined: 24 Sep 2012 22:06
Location: Fate, Texas

Re: "The directory name is invalid" error

Post 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.

DrBunsen
Posts: 5
Joined: 24 Sep 2012 22:06
Location: Fate, Texas

Re: "The directory name is invalid" error

Post 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.

Post Reply