Ajuste o cmd.exe para exibir o caminho da pasta

0

Eu quero ajustar o cmd.exe para exibir os nomes longos no curto como exemplo C:\Documents and Settings\ em C:\DOCUM~1

Eu sei que isso pode ser feito com command.exe , mas não tem o recurso de preenchimento automático.

Existe algum ajuste ou ferramenta para exibir o caminho como esse usando o cmd.exe?

    
por ukanth 13.10.2009 / 08:34

4 respostas

2

AFAIK isso não é possível, consulte este artigo que discute todos os truques possíveis para fazer com o prompt do cmd.exe:

Um melhor PROMPT para CMD.EXE ou Cool Prompt Environment Variables e um nice multi-prompt transparente

Como notado aqui, há muitas conchas de substituição cmd que são mais flexíveis.

    
por 13.10.2009 / 10:05
2

Eu acho que você quer dizer command.com, não command.exe.

Não há como obter os nomes curtos de arquivos em cmd.exe na minha opinião.

Você pode usar T akeCommand Console LE . É grátis e um substituto para cmd.exe com muitos recursos extras. Ele suporta autocompletar (com a tecla TAB) e nomes de arquivos curtos.

Eles explicam isso no helpfile:

On LFN drives, TCC will search for and display long filenames during filename completion. If you want to search for 8.3 short filenames (SFNs), press Ctrl-A before you start using filename completion. This allows you to use filename completion on LFN drives with applications that do not support long filenames. The LFNToggle directive can be used to change the keystroke assigned to this feature.

You can press Ctrl-A at any time prior to beginning filename completion. The switch to SFN format remains is in effect for the remainder of the current command line. When TCC begins a new command line it returns to long filename format until you press Ctrl-A again.

You can also press Ctrl-A just after a filename is displayed, and the name will be converted to short filename format. However, this feature only affects the most recently entered file or directory name (the part between the cursor and the last backslash [] on the command line), and any subsequent entries. It will not automatically convert all the parts of a previously entered path.

Ctrl-A toggles the filename completion mode, so you can switch back and forth between long and short filename displays by pressing Ctrl-A each time you want to change modes.

    
por 13.10.2009 / 09:10
1

Não pode ser feito. A saída de help prompt fornece uma lista do que pode ser feito:

C:\>HELP PROMPT
Changes the cmd.exe command prompt.

PROMPT [text]

text Specifies a new command prompt.

Prompt can be made up of normal characters and the following special codes:

$A & (Ampersand) $B | (pipe) $C ( (Left parenthesis) $D Current date $E Escape code (ASCII code 27) $F ) (Right parenthesis) $G > (greater-than sign) $H Backspace (erases previous character) $L < (less-than sign) $N Current drive $P Current drive and path $Q = (equal sign) $S (space) $T Current time $V Windows version number $_ Carriage return and linefeed $$ $ (dollar sign)

If Command Extensions are enabled the PROMPT command supports the following additional formatting characters:

$+ zero or more plus sign (+) characters depending upon the depth of the PUSHD directory stack, one character for each level pushed.

$M Displays the remote name associated with the current drive letter or the empty string if current drive is not a network drive.

É possível obter essas informações em outros contextos CMD, usando a sintaxe %~ em call e for . Por exemplo, considere este script:

@ECHO OFF
call :X "%CD%"
goto :EOF

:X echo %1 echo %~s1

A saída é:

"C:\Documents and Settings"
C:\DOCUME~1

Veja call /? e for /? para detalhes.

Não é surpresa que isso seja trivial no PowerShell. No PowerShell, o prompt não tem sua própria sintaxe especial; é uma função perfeitamente normal. Você pode usar

Get-ShortPath $PWD
    
por 08.02.2010 / 18:14
0

Para forçar nomes de arquivos curtos 8.3, use o comando dir com a opção invertida / N, assim:

dir /-N

Além disso, eu uso o Console , um aprimoramento do console, que também suporta o preenchimento automático.

    
por 13.10.2009 / 13:18