forked from DumbRhythmGamer/rick.roll
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrick.roll.forwin.vbs
More file actions
36 lines (26 loc) · 950 Bytes
/
Copy pathrick.roll.forwin.vbs
File metadata and controls
36 lines (26 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function readFromRegistry (strRegistryKey, strDefault)
Dim WSHShell, value
On Error Resume Next
Set WSHShell = CreateObject ("WScript.Shell")
value = WSHShell.RegRead (strRegistryKey)
if err.number <> 0 then
readFromRegistry= strDefault
else
readFromRegistry=value
end if
set WSHShell = nothing
end function
function OpenWithChrome(strURL)
Dim strChrome
Dim WShellChrome
strChrome = readFromRegistry ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe\Path", "")
if (strChrome = "") then
strChrome = "chrome.exe"
else
strChrome = strChrome & "\chrome.exe"
end if
Set WShellChrome = CreateObject("WScript.Shell")
strChrome = """" & strChrome & """" & " " & strURL
WShellChrome.Run strChrome, 1, false
end function
OpenWithChrome "https://youtu.be/dQw4w9WgXcQ?autoplay=1"