A ver sataniconatillas y toda tu panda de developas a sueldo de oro, y sobre todo a ti, ese viejete entrañable de ntinternals… ¡Yo os quería, os apreciaba!
¿Por qué me haceis esto?
Y no, no he ido al mundo de matrix pero donde esté una buena línea de comandos que se quite cualquier interfáz gráfica.
Os pongo en antecedentes.
Acabo de grabar y editar un podcast.
Como es lógico, la postproducción que yo hago no es solo exportar en mp3 y listo, no. Edito metadatos, edio y normalizo el formato… recodifico…
Y ese recodificado lo hago con ffmpeg en línea de comandos, por que sí, por que yo lo valgo, y porque no he encontrado ningún frontend que haga todo eso por mi.
Hasta ahora, y desde NT3.51 (con DOS usaba ndos y 4dos como sustitutos del command.com, no me culpeis, mas bien agradecedmelo) CMD.EXE era una roca.
En Windows 2000 incluyeron por primera vez de serie el autocompletar en línea de comandos. pero tocando debidamente el registro, en NT4 y NT3.51 se podía hacer lo mismo. Y todo eso… Hasta hoy. Os juro que en este equipo, nuevo, con imagen de fabrica y aún en la 10.0.17134.320 AKA 1803, tengo el problema de que la tecla TAB ha dejado de funcionar en el CMD.EXE.
Obviamente si funciona en powershell. Lo he probado.
Aunque no se ve, ahí estoy yo dando al tabulador como si no hubiese un mañana para no tener que escribir todo eso.
Lo primero que se me ha ocurrido, ¿no había propiedades nuevas o algo así?
Ale, vamos a habilitarlas, aunque se que se llevan mal con cosas como volvok commander y dbase3plus, pero ¿y quien usa eso? pues yo también.
Bueno, pues tras relanzar… sigo en las mismas. Si es que no tiene lógica porque en las otras dos máquinas que tengo a mano ahora, con el mismo build no tienen ese problema.
Saco la ayuda que luego transcribiré abajo, porque es mejor un buen texto que no cuatro chorras de fotos. Pulsando se agrandan, pero hace falta una pantalla en condiciones.
Según la ayuda, ctrl+D completaría directorios y ctrl+F completaría ficheros. Vale…
mmmm. Pues no.
Anda mira, es que solo no lo hace, pero si invoco a CMD.EXE /F:ON es cuando empieza a completar. Vale, cojonudo.
Esta mierda me obliga a que si quiero modificar un puñetero script con llamadas a ficheros impronunciables tenga que invocar al intérprete practicamente en modo desarrollo… Pues no.
Vamos a mirar al registro, a los hives generales de toda la máquina como por ejemplo
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar
Según esos dos valores, el caracter de autocompletado es la puñetera arroba. Sí, esta -> @ <- con valor hexadecimal 0x40 y decimal/ASCII 64.
Ni que decir tiene que ni de coña, ya que es un caracter de los chungos y que nadie debería usar en un sistema de ficheros por voluntad propia.
Ahora una capturita del ordenador que tengo actualizando…
Se le parece, ¿verdad? Y ahí funciona.
Comparamos…
Anda leche, pues es que falta una rama en el hive del usuario actual que deriva del usuario por defecto…
¡¿Pero que mierda es esta Microsoft?! ¡¿Por que tengo que hacer a mano el trabajo de tus programadores?!
Ale, a currar con lo que tenemos.
En un ficheroto de texto, o en un «copy con autocompletar.reg» escribid esto
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor]
"DefaultColor"=dword:00000000
"EnableExtensions"=dword:00000001
"CompletionChar"=dword:00000009
"PathCompletionChar"=dword:00000009
He cambiado los 0x40 que no sirven para nada y he puesto un 0x09 que es el código de scan de teclado correspondiente al tabulador.
El que ha hecho el «copy con», para guardar y salir, ctrl+Z o F6.
Incorporad el fichero al registro, ya sabeis como y si no sabeis, mejor que no toqueis esto, y reiniciad.
A partir de aquí, todo esto es la ayuda del CMD.EXE en Windows 10.0.17134.320
Leedlo bajo buestra responsabilidad y preocupación por vuestra salud mental
Starts a new instance of the Windows command interpreter CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string] /C Carries out the command specified by string and then terminates /K Carries out the command specified by string but remains /S Modifies the treatment of string after /C or /K (see below) /Q Turns echo off /D Disable execution of AutoRun commands from registry (see below) /A Causes the output of internal commands to a pipe or file to be ANSI /U Causes the output of internal commands to a pipe or file to be Unicode /T:fg Sets the foreground/background colors (see COLOR /? for more info) /E:ON Enable command extensions (see below) /E:OFF Disable command extensions (see below) /F:ON Enable file and directory name completion characters (see below) /F:OFF Disable file and directory name completion characters (see below) /V:ON Enable delayed environment variable expansion using ! as the delimiter. For example, /V:ON would allow !var! to expand the variable var at execution time. The var syntax expands variables at input time, which is quite a different thing when inside of a FOR loop. /V:OFF Disable delayed environment expansion. Note that multiple commands separated by the command separator '&&' are accepted for string if surrounded by quotes. Also, for compatibility reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the same as /C. Any other switches are ignored. If /C or /K is specified, then the remainder of the command line after the switch is processed as a command line, where the following logic is used to process quote (") characters: 1. If all of the following conditions are met, then quote characters on the command line are preserved: - no /S switch - exactly two quote characters - no special characters between the two quote characters, where special is one of: &<>()@^| - there are one or more whitespace characters between the two quote characters - the string between the two quote characters is the name of an executable file. 2. Otherwise, old behavior is to see if the first character iis a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character. If /D was NOT specified on the command line, then when CMD.EXE starts, it looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if either or both are present, they are executed first. HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun Command Extensions are enabled by default. You may also disable extensions for a particular invocation by using the /E:OFF switch. You can enable or disable extensions for all invocations of CMD.EXE on a machine and/or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDIT.EXE: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions to either 0x1 or 0x0. The user specific setting takes precedence over the machine setting. The command line switches take precedence over the registry settings. In a batch file, the SETLOCAL ENABLEEXTENSIONS or DISABLEEXTENSIONS arguments takes precedence over the /E:ON or /E:OFF switch. See SETLOCAL /? for details. The command extensions involve changes and/or additions to the following commands: DEL or ERASE COLOR CD or CHDIR MD or MKDIR PROMPT PUSHD POPD SET SETLOCAL ENDLOCAL IF FOR CALL SHIFT GOTO START (also includes changes to external command invocation) ASSOC FTYPE To get specific details, type commandname /? to view the specifics. Delayed environment variable expansion is NOT enabled by default. You can enable or disable delayed environment variable expansion for a particular invocation of CMD.EXE with the /V:ON or /V:OFF switch. You can enable or disable delayed expansion for all invocations of CMD.EXE on a machine and/or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDIT.EXE: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DelayedExpansion to either 0x1 or 0x0. The user specific setting takes precedence over the machine setting. The command line switches take precedence over the registry settings. In a batch file the SETLOCAL ENABLEDELAYEDEXPANSION or DISABLEDELAYEDEXPANSION arguments takes precedence over the /V:ON or /V:OFF switch. See SETLOCAL /? for details. If delayed environment variable expansion is enabled, then the exclamation character can be used to substitute the value of an environment variable at execution time. You can enable or disable file name completion for a particular invocation of CMD.EXE with the /F:ON or /F:OFF switch. You can enable or disable completion for all invocations of CMD.EXE on a machine and/or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDIT.EXE: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar with the hex value of a control character to use for a particular function (e.g. 0x4 is Ctrl-D and 0x6 is Ctrl-F). The user specific settings take precedence over the machine settings. The command line switches take precedence over the registry settings. If completion is enabled with the /F:ON switch, the two control characters used are Ctrl-D for directory name completion and Ctrl-F for file name completion. To disable a particular completion character in the registry, use the value for space (0x20) as it is not a valid control character. Completion is invoked when you type either of the two control characters. The completion function takes the path string to the left of the cursor appends a wild card character to it if none is already present and builds up a list of paths that match. It then displays the first matching path. If no paths match, it just beeps and leaves the display alone. Thereafter, repeated pressing of the same control character will cycle through the list of matching paths. Pressing the Shift key with the control character will move through the list backwards. If you edit the line in any way and press the control character again, the saved list of matching paths is discarded and a new one generated. The same occurs if you switch between file and directory name completion. The only difference between the two control characters is the file completion character matches both file and directory names, while the directory completion character only matches directory names. If file completion is used on any of the built in directory commands (CD, MD or RD) then directory completion is assumed. The completion code deals correctly with file names that contain spaces or other special characters by placing quotes around the matching path. Also, if you back up, then invoke completion from within a line, the text to the right of the cursor at the point completion was invoked is discarded. The special characters that require quotes are: <space> &()[]{}^=;!'+,`~
Síguenos