News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Windows 10 DOS windows

Started by TouEnMasm, June 27, 2020, 05:19:33 PM

Previous topic - Next topic

TouEnMasm

Hello,
Windows 10 allow to open a poweshell window by  shift + right clic on a directory.
I want a dos windows and i find a method writing the registry,code is in the zip.
The cmd is a batch calling  "C:\Windows\System32\cmd.exe %1"
Problem the directory is passed or not , any idea ?
Fa is a musical note to play with CL

hutch--

Yves,

I had a look at the registry file you attached but I don't understand what you are trying to do.

Usually CMD.EXE will give you the default Win10 prompt and from that you can run powershell if you need to.

TimoVJL

I use this with Windows 7
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\*\shell\Open With cmd\command]
@="\"cmd.exe\" \"/k \"%1\"\""

May the source be with you

Vortex

Hi Timo,

Thanks, that's a nice registry tweaking. Converting the registry entry to a batch file :

Reg.exe add "HKCU\Software\Classes\*\shell\Open With cmd\command" /ve /t REG_SZ /d "\"cmd.exe\" \"/k \"%%1\"\"" /f

jj2007

Put it in C:\Users\ToutEnMasm\AppData\Roaming\Microsoft\Windows\SendTo

include \masm32\include\masm32rt.inc
.code
start:
  invoke WinExec, chr$("cmd.exe"), SW_RESTORE
  invoke ExitProcess, 0
end start

TouEnMasm

After some tests:
Quote
Windows Registry Editor Version 5.00

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

[HKEY_CLASSES_ROOT\Folder\shell\CmdPrompt\command]
@="\"C:\\OpenDosPrompt\" \"%1\""

--------------- batch OpenDosPrompt.bat in c:\----------------------
CD %1
C:\Windows\System32\cmd.exe


And the dos windows open on the directory you have right clic
Fa is a musical note to play with CL

Vortex

For Windows XP :

REG ADD "HKCR\Directory\shell\Command Prompt Here\Command" /f /t REG_SZ /ve /d "cmd.exe /k cd %%1"

https://www.trishtech.com/2010/02/add-command-prompt-here-to-right-click-menu-in-windows-xp/