传递参数BAT文件,并通过双击运行 [英] Pass parameter to BAT file and run by double click
问题描述
我想传递两个文件路径(窗口)的脚本作为命令行参数。在windows,如果我们在文件上单击鼠标右键,我们可以看到属性选项有常规选项卡下显示的test.bat一样的文件名。我们可以从那里传递参数?
I want to pass two file path (for windows) to the script as command line parameters. In windows if we right-click on a file we can see Properties option and there under General tab the file name like test.bat is displayed. Can we pass parameter from there?
其实我要的是如之前所说传递两个参数,赶上那些从脚本,进行相应操作。 BAT文件应双击执行。是否可以?我搜索谷歌,但发现没有什么(可能是我不知道这个正确的搜索查询)。
Actually what I want is to pass two parameters as said before and catch those from the script, operate accordingly. The bat file should be executed by double clicking. Is it possible? I searched Google but found nothing (may be I don't know proper search query for this).
推荐答案
您不能直接办:你需要创建一个Windows快捷方式在资源管理器文件(单击鼠标右键,选择的创建快捷方式),然后您可以编辑快捷方式的目标字段将它传递的参数。
You can't do it directly: you need to create a Windows shortcut (right-click on the file in Explorer, select Create Shortcut), and then you can edit the shortcut's Target field to pass it the parameters.
这篇关于传递参数BAT文件,并通过双击运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!