VBScript使用英语构建,但不是法语版本

时间:2016-03-04 04:26:19

标签: vbscript

我有以下脚本在任务栏中添加快捷方式。它在英语版本中完美运行,但在Windows 7的法语版本中失败。

on error resume next

Const CSIDL_COMMON_PROGRAMS = &H17
Const CSIDL_PROGRAMS = &H2
Const CSIDL_STARTMENU = &HB


Set objShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objCurrentUserStartFolder = objShell.NameSpace (CSIDL_STARTMENU)
strCurrentUserStartFolderPath = objCurrentUserStartFolder.Self.Path
Set objAllUsersProgramsFolder = objShell.NameSpace(CSIDL_COMMON_PROGRAMS)
strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path

' - Pin to Taskbar -

If objFSO.FileExists(strAllUsersProgramsPath & "\TN3270 Plus\TN3270 Central.lnk") Then             'path of the shortcut in start menu
Set objFolder = objShell.Namespace(strAllUsersProgramsPath &"\TN3270 Plus")                   'name of the folder in which the shortcut is placed in start menu
Set objFolderItem = objFolder.ParseName("TN3270 Central.lnk")                           'Short cut name
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt

Next
End If

有人可以看看并帮助我。

0 个答案:

没有答案