如何在 Windows 上下文菜单中创建功能
我使用 jsmin 来压缩我的 javascript 文件,然后再将其上传到生产环境。
由于我倾向于每页都有一个“代码隐藏”的 javascript 文件,因此我最终会经常这样做。
我安装了一个 Windows Powertoy,它在 Windows 资源管理器中添加了一个上下文菜单项,因此我可以“在此处打开命令窗口”。 当我单击该按钮时,命令提示符会在正确的目录中打开。 这可以节省一点打字时间。
但是,我仍然需要输入类似以下内容:
jsmin <script.js> script.min.js
才能使其正常工作。 这就麻烦了。
我想创建一个上下文菜单项,允许我右键单击 *.js 文件并选择“jsmin 压缩此文件”。 然后jsmin将被调用,原始文件将被压缩为“original_filename.min.js”
我该怎么做?
I use jsmin to compress my javascript files before uploading them to production.
Since I tend to have one "code-behind" javascript file per page, I wind up doing this a lot.
I installed a Windows Powertoy that adds a context menu item in Windows Explorer, so I can "Open Command Window Here". When I click that, the command prompt opens up in the right directory. That saves a little bit of typing.
However, I still have to type something like:
jsmin <script.js> script.min.js
To get it to work. This is a hassle.
I'd like to create a context menu item that will allow me to right-click on a *.js file and select "jsmin-compress this file." Then jsmin would be invoked, and the original file would be compressed into "original_filename.min.js"
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
以下是如何向 .js 文件的上下文菜单添加条目:
Here is how to add an entry to your context menu for .js files:
您可以将批处理脚本的链接放入用户 sendto 目录中。 类似的事情
我通常会做
you could drop a link to a batch script into the user sendto directory. Something like
which is what I usually do
您可以使用批处理文件并打开方式来完成此操作...
You could do it using a batch file and Open With...