返回列表 发帖

[文件操作] [有奖翻译]T005:命令行工具Shortcut.exe1.11(创建快捷方式)

【活动说明】http://bbs.bathome.net/thread-2991-1-1.html

【官方下载】http://www.optimumx.com/download/#Shortcut

【本地下载】http://bcn.bathome.net/s/tool/index.html?key=Shortcut

【最新版本】1.11(2005-07-04)

【任务内容】
Shortcut [Version 1.11]
Creates, modifies or queries Windows shell links (shortcuts)
The syntax of this command is:
shortcut /F:filename /A:C|E|Q [/T:target] [/P:parameters] [/W:workingdir]
[/R:runstyle] [/I:icon,index] [/H:hotkey] [/D:description]
/F:filename : Specifies the .LNK shortcut file.
/A:action : Defines the action to take (C=Create, E=Edit or Q=Query).
/T:target : Defines the target path and file name the shortcut points to.
/P:parameters : Defines the command-line parameters to pass to the target.
/W:working dir : Defines the working directory the target starts with.
/R:run style : Defines the window state (1=Normal, 3=Max, 7=Min).
/I:icon,index : Defines the icon and optional index (file.exe or file.exe,0).
/H:hotkey : Defines the hotkey, a numeric value of the keyboard shortcut.
/D:description : Defines the description (or comment) for the shortcut.
Notes:
- Any argument that contains spaces must be enclosed in "double quotes".
- If Query is specified (/A:Q), all arguments except /F: are ignored.
- To find the numeric hotkey value, use Explorer to set a hotkey and then /A:Q
- To prevent an environment variable from being expanded until the shortcut
   is launched, use the ^ carat escape character like this: ^%WINDIR^%
Examples:
   /f:"%ALLUSERSPROFILE%\Start Menu\Programs\My App.lnk" /a:q
   /f:"%USERPROFILE%\Desktop\Notepad.lnk" /a:c /t:^%WINDIR^%\Notepad.exe /h:846
   /f:"%USERPROFILE%\Desktop\Notepad.lnk" /a:e /p:C:\Setup.log /r:3
An argument of /? or -? displays this syntax and returns 1.
A successful completion will return 0.
Copyright 2000-2005 Marty List, www.OptimumX.comCOPY
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

哪位达人翻译成中文就好了!!
E文不懂啊!!!惭愧。。。
有一种爱叫放弃

TOP

(依据在线翻译)抛砖引玉,望达人们补充完整
Shortcut [版本 1.11]
创建,修改或查询快捷方式
这个命令的语法是:
shortcut /F:filename /A:C|E|Q [/T:target] [/P:parameters] [/W:workingdir]
         [/R:runstyle] [/I:icon,index] [/H:hotkey] [/D:description]
/f:filename      :指定快捷方式的名称.lnk 【可直接指定存放的路径,不指定则为当前】
/a:action        :指定动作(c=创建 e=修改 q=查询)
/t:target        :指定目标文件【要绝对路径】
/p:parameters    : Defines the command-line parameters to pass to the target.
/W:working dir   : Defines the working directory the target starts with.
/r:run style     :定义目标文件的窗口状态(1=正常 3=最大 7=最小)
/I:icon,index    : Defines the icon and optional index (file.exe or file.exe,0).
/H:hotkey        : 定义热键  键盘上对应的ASCII码
/D:description   :快捷方式的描述或评论(就是当鼠标指向快捷方式时,显示的说明)COPY
1

评分人数

有一种爱叫放弃

TOP

用nircmd就可以了啊

TOP

回复 4楼 的帖子

我们追求的是多样化的解决方案,不能只局限于单一。
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

原帖由 zjw767676 于 2009-4-4 14:53 发表
(依据在线翻译)抛砖引玉,望达人们补充完整Shortcut [版本 1.11]

创建,修改或查询快捷方式

这个命令的语法是:

shortcut /F:filename /A:C|E|Q [/T:target] [/P:parameters] [/W:workingdir]
          ...
Shortcut [V 1.11]
创建,修改或查询快捷方式
这个命令的语法是:
shortcut /F:文件名 /A:C|E|Q [/T:目标] [/P:自定义运行参数] [/W:起始位置]
         [/R:窗口状态] [/I:图标,位置] [/H:快捷键] [/D:描述]
/f:文件名      :快捷方式名.lnk 【可指定存放的"绝对路径",不指定则为当前路径】
/a:动作        :指定动作(c=新建快捷方式 e=修改快捷方式 q=查询快捷方式)
/t:目标        :要创建快捷方式的文件【需要绝对路径】
/p:自定义运行参数    : 快捷方式的运行参数
/W:起始位置   : 设置起始位置
/r:窗口状态     : 自定义目标文件的窗口状态(1=正常 3=最大 7=最小)
/I:图标,位置    : 自定义图标和可选的图标位置 (例:文件名.exe or 文件名.exe,0).
/H:快捷键        : 定义热键  对应键盘上的 ASCII 码
/D:描述   :快捷方式的描述(当鼠标指向快捷方式时显示说明)
注意:
- 任何包含空格的参数必须放进双引号里面。
- 如果使用【/A:Q】命令查询,除了【/F:】其他的命令都会被忽略。
- 查询某个快捷键可以先手动创建一个带有改快捷键的快捷方式之后使用【/A:Q】命令查询。(我记得网上有参考的...)
- 为了防止 环境变量 扩展直到程序完全启动,使用^这个转义字符可以避免比如:^%WINDIR^%
举例:
   /f:"%ALLUSERSPROFILE%\「开始」菜单\程序\附件\计算器.lnk" /a:q
   /f:"%USERPROFILE%\桌面\记事本.lnk" /a:c /t:^%WINDIR^%\Notepad.exe /h:846
   /f:"%USERPROFILE%\桌面\记事本.lnk" /a:e /p:C:\Setup.log /r:3
参数"/?""-?"显示此帮助和返回1
成功会返回0
版权所有 2000-2005 Marty List, www.OptimumX.com
※set tag=%userprofile%\Application Data\Microsoft\Internet Explorer\Quick Launch
set %9=
Shortcut /F:"%tag%\启动 Internet Explorer 浏览器.lnk" /A:C /T:"%ProgramFiles%\Internet Explorer\iexplore.exe" /P:%IE首页% /W:%%%1HOMEDRIVE%%%9%%%9HOMEPATH%%%9 /R:3 /I:"%ProgramFiles%\Internet Explorer\iexplore.exe",0
这个呢...用来每次开机修复下链接用的(放到"开始菜单\启动"文件夹)。因为我经常下载东西首页也经常被改(当然还每次开机修改注册表自己劫持IE首页)。
PS:VBS版太难了所以就想用这个工具,顺手翻译了下。如有差错还请见谅^_^
还有“%%%9%%%9”是用来变成两个%的,“^%WINDIR^%”这个方法发生成出来的打不开(汗...)COPY

[ 本帖最后由 jixun66 于 2010-7-18 05:43 编辑 ]
1

评分人数

TOP

翻译了一整个下午~
Shortcut [Version 1.11]
Shortcut [版本1.11]
Creates, modifies or queries Windows shell links (shortcuts)
创建,修改或查询快捷方式
The syntax of this command is:
次命令的语法为:
shortcut /F:filename /A:C|E|Q [/T:target] [/P:parameters] [/W:workingdir]
         [/R:runstyle] [/I:icon,index] [/H:hotkey] [/D:description]
Shortcut    [/F:文件名]    [/A:C|E|Q ]   [/T:目标 ]  [/p:参数]    [/W:运行目录]   [/R:运行时窗口的显示状态]        [/I:图标,图标的位置]   [/H:快捷键]   [/D:描述]
/F:filename        : Specifies the .LNK shortcut file.  
/F:文件名 :指定一个.lnk快捷方式文件的绝对路径,不指则为当前的路径
/A:action        : Defines the action to take (C=Create, E=Edit or Q=Query).
/A:动作:指定某个动作(C=创建,E=编辑,Q=查询)
/T:target        : Defines the target path and file name the shortcut points to.
/T:目标:指定要创建快捷方式的绝对路径和文件名
/P:parameters        : Defines the command-line parameters to pass to the target.
/p:参数:指定要目标执行的命令行参数
/W:working dir        : Defines the working directory the target starts with.
/W:运行目录:定义目标开始工作的目录
/R:run style        : Defines the window state (1=Normal, 3=Max, 7=Min).
/R:运行时窗口的显示状态:自定义窗口的运行状态(1=普通,3=最大,7=最小)
/I:icon,index        : Defines the icon and optional index (file.exe or file.exe,0).
/I:图标,图标的位置:自定义快捷方式的图标和图标的位置(文件名.exe 或者  文件名.exe,0
/H:hotkey        : Defines the hotkey, a numeric value of the keyboard shortcut.
/H:快捷键:自定义一个快捷键,可以是数值或者是键盘的快捷键(例如Alt+Ctrl+Del等等)
/D:description        : Defines the description (or comment) for the shortcut.
/D:描述:为快捷方式添加描述(当鼠标指向快捷方式的显示出来的气泡提示,例如:某某文件的快捷方式或者它的绝对路径)
Notes:
注:
- Any argument that contains spaces must be enclosed in "double quotes".
-任何有空格的参数必须使用双引号“包”起来
- If Query is specified (/A:Q), all arguments except /F: are ignored.
-如果使用/A:Q命令查询,除了参数/F:之外,所有的参数将被忽略
- To find the numeric hotkey value, use Explorer to set a hotkey and then /A:Q
-*如果要查询一个快捷键,使用资源管理器来设定一个快捷键,然后再使用参数/A:Q查询         
- To prevent an environment variable from being expanded until the shortcut
   is launched, use the ^ carat escape character like this: ^%WINDIR^%
-**为了避免某个环境变量在创建快捷方式运行时扩展,请使用转义字符^,例如:^%WINDIR^%
Examples:
例子:  
/f:"%ALLUSERSPROFILE%\Start Menu\Programs\My App.lnk" /a:q
/f:"%USERPROFILE%\Desktop\Notepad.lnk" /a:c /t:^%WINDIR^%\Notepad.exe /h:846
/f:"%USERPROFILE%\Desktop\Notepad.lnk" /a:e /p:C:\Setup.log /r:3
An argument of /? or -? displays this syntax and returns 1.
参数 /? 或者-? 将显示此帮助文件并返回1
A successful completion will return 0.
成功会返回0
Copyright 2000-2005 Marty List, www.OptimumX.com
版权所有 2000-2005 Marty List,www.OptimumX.com
*应该是指:如果要查询一个快捷方式的快捷键,右击那个快捷键,选择属性(Properties),然后再快捷键的框框,按想要的快捷键(例如:例子:"%USERPROFILE%\Desktop\Notepad.lnk" /a:c /t:^%WINDIR^%\Notepad.exe /h:846的快捷键是Ctrl+Shift+N),然后可以使用参数/A:Q查询        
**因为变量在命令提示符中会被扩展,所以使用转义字符来避免。^%WINDIR^%是某个文件的绝对路径,而不是环境变量,就像
echo  %WINDIR% > test.txt  
test.txt中显示的是C:\Windows\
echo ^%WINDIR^% > test.txt
test.txt中显示的是却是%WINDIR%
的道理是一样的,希望看得明白~COPY

TOP

看过后很有收获,对自己目前手头的一个项目大有裨益,认真学习、好好消化。多谢分享!
天道酬勤、地道酬善、人道酬诚、商道酬信、业道酬精。

TOP

创建快捷工具很多
这个工具算不错

TOP

返回列表