Can I create shorthand names for use inside cmd?

前端 未结 2 1172
盖世英雄少女心
盖世英雄少女心 2020-12-22 13:18

Is it possible to make shortcuts so that I can type \"cd desk\" instead of \"cd desktop\" to change directory to the desktop? This would only work if desktop is the only fol

相关标签:
2条回答
  • 2020-12-22 14:04

    See Doskey /?.

    You could do this

    doskey cddesk=cd "%userprofile%\desktop"
    

    Then type cddesk.

    By putting all your macros in a batch file you can autoload. Of course you could do this with batchfiles too.

    From Technical Reference to the Windows 2000 Registry, Microsoft, 2000.

    AutoRun

    HKCU\Software\Microsoft\Command Processor 
    

    Data type Range Default value

    REG_SZ list of commands There is no default value for this entry.

    Description

    Contains commands which are executed each time you start Cmd.exe.

    Also see this batchfile https://pastebin.com/A2qLw8r3 that list special names.

    In a command prompt

    start shell:desktop
    

    Or in Start - Run (Winkey + R) just

    shell:desktop
    
    0 讨论(0)
  • 2020-12-22 14:05

    No, you can't, but you can use the Tab key to complete the correct name. Pressing Tab multiple time cycles through the matching names existing in the current directory.

    0 讨论(0)
提交回复
热议问题