Can I create shorthand names for use inside cmd?

前端 未结 2 1184
盖世英雄少女心
盖世英雄少女心 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
    

提交回复
热议问题