【问题标题】:Creating a cmd line shortcut创建命令行快捷方式
【发布时间】:2016-02-11 08:58:15
【问题描述】:

我是 Windows 的新手,因为我是 OSX 用户。

我每天都必须在 cmd 行中运行一项任务,有什么方法可以在我的桌面上创建一个快捷方式来自动执行此操作?

任务示例,打开cmd,然后执行:

atomInstaller npm -view -Xmx8g -Xms3g

谢谢

【问题讨论】:

    标签: batch-file cmd windows-7


    【解决方案1】:

    您可以创建 cmd.exe 的快捷方式并添加命令行开关:

    https://superuser.com/questions/358565/adding-command-line-switches-to-windows-shortcuts

    或者您可以使用记事本(或更好的文本编辑器)将命令放入批处理文件:

    @echo off
    atomInstaller npm -view -Xmx8g -Xms3g
    

    将其保存为 npm.bat 然后双击它..

    【讨论】:

      【解决方案2】:

      你可以使用shortcutjs.bat:

      call shortcutjs.bat -linkfile "%userprofile%\desktop\atominstaller.lnk" -target "C:\atomInstaller.bat" -adminpermissions yes -iconlocation "C:\Windows\System32\compstui.dll,3" -hotkey "Ctrl+Shift+M"
      

      用法如下:

      shortcutjs.bat -linkfile link -target target [-linkarguments linkarguments]   [-description description] [-iconlocation iconlocation] [-hotkey hotkey]  [-windowstyle 1|3|7] [-workingdirectory workingdirectory] [-adminpermissions yes|no]
      

      您可以使用-linkarguments 添加其他参数或使用-workingdirectory 开始位置

      【讨论】:

        猜你喜欢
        • 2012-05-12
        • 1970-01-01
        • 2019-05-06
        • 2020-10-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多