Author Topic: Windows 10 DOS windows  (Read 143 times)

TouEnMasm

  • Member
  • *****
  • Posts: 1216
    • EditMasm
Windows 10 DOS windows
« on: June 27, 2020, 05:19:33 PM »
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--

  • Administrator
  • Member
  • ******
  • Posts: 7296
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Windows 10 DOS windows
« Reply #1 on: June 27, 2020, 07:09:21 PM »
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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TimoVJL

  • Member
  • ****
  • Posts: 525
Re: Windows 10 DOS windows
« Reply #2 on: June 27, 2020, 07:14:36 PM »
I use this with Windows 7
Code: [Select]
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

  • Member
  • *****
  • Posts: 2241
Re: Windows 10 DOS windows
« Reply #3 on: June 27, 2020, 07:27:48 PM »
Hi Timo,

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

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

jj2007

  • Member
  • *****
  • Posts: 10319
  • Assembler is fun ;-)
    • MasmBasic
Re: Windows 10 DOS windows
« Reply #4 on: June 27, 2020, 07:45:38 PM »
Put it in C:\Users\ToutEnMasm\AppData\Roaming\Microsoft\Windows\SendTo

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

TouEnMasm

  • Member
  • *****
  • Posts: 1216
    • EditMasm
Re: Windows 10 DOS windows
« Reply #5 on: June 27, 2020, 08:08:55 PM »
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

  • Member
  • *****
  • Posts: 2241
Re: Windows 10 DOS windows
« Reply #6 on: June 28, 2020, 09:07:22 PM »
For Windows XP :

Code: [Select]
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/