obiwantuxedo
MIS
I am new to VBScripting and have been trying a few things. I have run into a problem that I have not been able to solve.
I am trying to create two shortcuts that are placed on the QUick Launch bar . The first one works fine, but the second
does not. Any help would be greatly appreciated.
'Create Quick launch shortcuts
Set WshShell = CreateObject("WScript.Shell"
strPath = "c:\Documents and Settings\moored\Application Data\Microsoft\Internet Explorer\Quick Launch"
'Create Quick Launch shortcut for Command Prompt
Set objShortcutLnk = WshShell.CreateShortcut(strPath & "\Command Prompt.lnk"
objShortcutLnk.TargetPath = "%windir%\System32\cmd.exe"
objShortcutLnk.WorkingDirectory = "%windir%"
objShortcutLnk.WindowStyle = 1
objShortcutLnk.Save
'Create Quick Launch shortcut for Explorer
Set objShortcutLnk = WshShell.CreateShortcut(strPath & "\Explorer.lnk"
objShortcutLnk.TargetPath = "%windir%\explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
objShortcutLnk.WorkingDirectory = "%windir%"
objShortcutLnk.WindowStyle = 3
objShortcutLnk.Save
Result...
A shortcut is created but not associated to explorer. Looking at the properties I find that the Target looks like this:
"%windir%\explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" Quotations included.
When executed, the following messages occur
Error Message:
C:\WINNT\explorer.exe /e,::\ is not accessible. The filename, directory name, or volume label syntax is incorrect.
Missing Shortcut:
Windows is searching for {20D04FE0-3AEA-1069-A2D8-08002B30309D}
If I open the properties for the shortcut, and remove the two quotation marks from the target, the shortcut works perfectly.
How do I fix it without manually editing?
I am trying to create two shortcuts that are placed on the QUick Launch bar . The first one works fine, but the second
does not. Any help would be greatly appreciated.
'Create Quick launch shortcuts
Set WshShell = CreateObject("WScript.Shell"
strPath = "c:\Documents and Settings\moored\Application Data\Microsoft\Internet Explorer\Quick Launch"
'Create Quick Launch shortcut for Command Prompt
Set objShortcutLnk = WshShell.CreateShortcut(strPath & "\Command Prompt.lnk"
objShortcutLnk.TargetPath = "%windir%\System32\cmd.exe"
objShortcutLnk.WorkingDirectory = "%windir%"
objShortcutLnk.WindowStyle = 1
objShortcutLnk.Save
'Create Quick Launch shortcut for Explorer
Set objShortcutLnk = WshShell.CreateShortcut(strPath & "\Explorer.lnk"
objShortcutLnk.TargetPath = "%windir%\explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
objShortcutLnk.WorkingDirectory = "%windir%"
objShortcutLnk.WindowStyle = 3
objShortcutLnk.Save
Result...
A shortcut is created but not associated to explorer. Looking at the properties I find that the Target looks like this:
"%windir%\explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" Quotations included.
When executed, the following messages occur
Error Message:
C:\WINNT\explorer.exe /e,::\ is not accessible. The filename, directory name, or volume label syntax is incorrect.
Missing Shortcut:
Windows is searching for {20D04FE0-3AEA-1069-A2D8-08002B30309D}
If I open the properties for the shortcut, and remove the two quotation marks from the target, the shortcut works perfectly.
How do I fix it without manually editing?