none
Shortcut url to open In Chrome RRS feed

  • Question

  • when I run the script it creates the Icon and calls whatever I want, but wont open URL in Chrome. need help with the following

    Set WshShell = CreateObject("WScript.Shell")
    strDesktopPath = WshShell.SpecialFolders("Desktop")
    Set objShortcutUrl = WshShell.CreateShortcut(strDesktopPath & "\desktop shortcut.lnk")
    objShortcuturl.TargetPath = ProgramFilesRoot & "\Google\Chrome\Application\chrome.exe"  https://www.somesite.com
    objShortcutUrl.Save

    Thursday, September 28, 2017 1:09 AM

Answers

  • Hi,

    try specifying the url as arguments:

    Set WshShell = CreateObject("WScript.Shell")
    strDesktopPath = WshShell.SpecialFolders("Desktop")
    Set objShortcutUrl = WshShell.CreateShortcut(strDesktopPath & "\desktop shortcut.lnk")
    objShortcutUrl.TargetPath = WshShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\Google\Chrome\Application\chrome.exe"
    objShortcutUrl.Arguments = "https://www.somesite.com"
    objShortcutUrl.Save
    

    Cheers,
    Fred

    PS: Consider shifting to PowerShell - VBS is somewhat legacy by now and you can do the same in PS ... only easier.


    There's no place like 127.0.0.1

    • Marked as answer by Saberwal Thursday, September 28, 2017 3:57 PM
    Thursday, September 28, 2017 8:50 AM