Sub Chrome(URL)
'----------------------------------------------------------------------
' Purpose: Launch Chrome
' Arguments: <URL>
'----------------------------------------------------------------------
if (ubound(split(URL," ")) = 0) then
Dim objShell
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "chrome.exe", URL, "", "", 1
end if
end Sub
Hm, nothing happens when doing that.Set objShell = CreateObject("WScript.Shell")
objShell.Run "msedge URL"
should work
Using Windows 10. How would the script look like if using Powershell?Works for me, what version of Windows? Can you use powershell instead?
So like this?:It's depends how it needs to be called.
If it's a hard coded call then like this
Code:Start-Process -FilePath "msedge" -ArgumentList "https://google.com"
Sub Chrome(URL)
'----------------------------------------------------------------------
' Purpose: Launch Chrome
' Arguments: <URL>
'----------------------------------------------------------------------
if (ubound(split(URL," ")) = 0) then
Start-Process -FilePath "msedge" -ArgumentList "URL"
end if
end Sub
But there are multiple function in my .vbs file that contains lines like this:No you're mixing vbs and powershell. It's just the one line
Chrome "https://domain.my.salesforce.com/apex/ScreenPopView?nr=&cID=" + Params.ParamByName("cID") + "&crpnr=" + NR
Chrome
Sub Chrome(URL)
Start-Process -FilePath "msedge" -ArgumentList
The .vbs file is 4000 lines of code, so I was hoping to find a easier solution.Visual Basic and PowerShell are different languages you can't mix the code in a script. I was suggesting to just convert your code to Powershell, it's much simpler to write.
Probably a difference in Windows 10 versions. Both microsoft-edge: and microsoft-edge:// work on mine