首页 > 系统相关 >windows cmd alias

windows cmd alias

时间:2024-10-06 16:11:13浏览次数:1  
标签:DOSKEY bat windows cmd alias command Command aliases

It is rather easy to setup permanent aliases in the Windows command prompt using the @DOSKEY command and HKCU\Software\Microsoft\Command Processor Autorun option.

Quick step-by-step guide:

  1. Create a new batch file, call it Alias.bat. Copy/paste the text below. TIP: I recommend creating a C:\Bin folder for all your command line tools.
  2. Open the register HKEY_CURRENT_USER\Software\Microsoft\Command Processor.
  3. Add an String Value named Autorun and set the value to absolute path of the Alias.bat file.
  4. Done.

This batch file will execute every time you open a command prompt.

Contents of Alias.bat

DOSKEY ls=DIR $* 
DOSKEY cp=COPY $* 
DOSKEY xcp=XCOPY $*
DOSKEY mv=MOVE $* 
DOSKEY clear=CLS
DOSKEY h=DOSKEY /HISTORY
DOSKEY alias=if ".$*." == ".." ( DOSKEY /MACROS ) else ( DOSKEY $* )

Now you can type alias (i.e DOSKEY /MACROS) to view the current list of aliases/macros.

To add new aliases for the current session only you can use alias name=command.

 

windows - Command aliases in Command Prompt? - Super User: https://superuser.com/questions/150244/command-aliases-in-command-prompt

标签:DOSKEY,bat,windows,cmd,alias,command,Command,aliases
From: https://www.cnblogs.com/yusisc/p/18449155

相关文章

  • Windows常用快捷键
    Windows常用快捷键键盘功能键Tab、Shift、Ctrl、Alt、空格、Enter、Window、↑↓←→切换输入法Ctrl+Shift打开菜单Ctrl+Windows关闭窗口Alt+F4产生间隙空格键确定键Enter键盘快捷键全选、复制、粘贴、撤销、保存、关闭窗口、运行、永久删除......全选......
  • Windows计划任务出现0x1错误结果
    Windows计划任务出现0x1错误结果现象解决方法结果 现象参考不少的文章,基本上都是说因为权限的问题,但试了N次都不行,仍然报0x1的错误结果,亲测解决方法说明如下; 1.脚本本身没问题,手动本地可以执行;2.系统版本Windows10专业工作站版版本号21H2解决方法在设......
  • Git推送自动化:在Windows上轻松设置定时任务
    简介当我们写代码/笔记每次都要自己使用git手动的提交和推送代码/笔记到远程仓库,如果电脑能每天定时的推送的话就很方便。准备在开始步骤之前,首先你的git账号关联,远程仓库什么的都关联好了,并且成功提交至远程仓库过,以防还没的步骤失败~GIt、Windows步骤1.新建一个文本文档......
  • Windows应急响应-Auto病毒
    目录应急背景分析样本开启监控感染病毒查看监控分析病毒行为autorun.inf分析2.异常连接3.进程排查4.启动项排查查杀1.先删掉autorun.inf文件2.使用xuetr杀掉进程3.启动项删除重启排查入侵排查正常流程应急背景运维人员准备通过windows共享文档方式为公司员工下发软件安装,开启完......
  • 在Windows平台使用源码编译和安装PyTorch3D指定版本
    最近在部署SyncTalk虚拟数字人项目时,需要安装很多依赖项,在执行到pipinstall--no-index--no-cache-dirpytorch3d-fhttps://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1121/download.html这一句命令时,安装PyTorch3D失败,输出如下信息:(synctalk)C......
  • netsh winsock reset catalog 和 netsh int ip reset reset.log 是两个常用的 Windows
    netshwinsockresetcatalog和netshintipresetreset.log是两个常用的Windows命令,用于网络故障排除和恢复网络设置。下面是对这两个命令的详细解释:1. netshwinsockresetcatalog功能:重置Winsock目录,以修复与网络相关的问题。Winsock的作用:Winsock(WindowsSocke......
  • Windows Powershell and WSL terminal 路径
    在windowspowershell中访问C,D盘cdC:,cdD:,...:PSC:\Users\phil>cdC:PSC:\Users\phil>pwdPath----C:\Users\philPSC:\Users\phil>在windowspowershell中访问WSL:PSC:\Users\phil>cd\\wsl.localhost\Ubuntu\home\phil\在W......
  • Cisco Secure Client 5.1.6.103 (macOS, Linux, Windows & iOS, Andrord) - 远程访问
    CiscoSecureClient5.1.6.103(macOS,Linux,Windows&iOS,Andrord)-远程访问客户端思科安全客户端(包括AnyConnect)请访问原文链接:https://sysin.org/blog/cisco-secure-client-5/,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgCiscoSecureClient(includi......
  • windows 需要 U启动 皮多多 买便宜一个
    买PE启动U盘原版新包链接格盘才行 https://share.weiyun.com/i0xkj0JN分享地址在这用   《《U启动》》  品牌的启动盘安装u启动提供的还原版系统 出现最后一个失败按钮 需要点击《重试》那个按钮才行,然后再等安装完就可以启动了合理按启动项F11F12那个 ......
  • windows系统配置nginx环境运行pbootcms访问首页直接404的问题
    在PbootCMS安装过程中遇到访问首页和其他页面返回404错误的问题,特别是在Windows+Nginx+PHP的环境下,确实需要仔细排查。根据你的描述,填写授权码后问题得到了解决,但仍然需要了解具体原因和解决方案。问题分析伪静态规则未生效:伪静态规则未正确生效可能导致访问首页和其他......