Created
December 12, 2021 04:32
-
-
Save composite/20fa6a9144010879811f8c9b742642c0 to your computer and use it in GitHub Desktop.
A Temporary solution for msedge.exe is not respond in Application folder. find recent edge version and run real msedge.exe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function GetRecentFolder(path) | |
On Error Resume Next | |
Dim fso, folder, version | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set GetRecentFolder = Nothing | |
For Each folder in fso.GetFolder(path).SubFolders | |
version = CInt(Left(folder.Name, Instr(folder.Name, ".") - 1)) | |
If Err.Number = 0 And version > 0 Then | |
Set GetRecentFolder = folder | |
Else | |
'WScript.Echo Err.Description & ": " & folder.Name & " is not number: " & Left(folder.Name, Instr(folder.Name, ".") - 1) | |
Err.Clear | |
End If | |
Next | |
On Error Goto 0 | |
End Function | |
Dim recentFile, WshShell, ArgList | |
Set recentFile = GetRecentFolder(Mid(WScript.ScriptFullName, 1, (Len(WScript.ScriptFullName) - Len(WScript.ScriptName)))) | |
If recentFile is Nothing Then | |
WScript.Echo "No edge version folders found" | |
Else | |
ReDim ArgList(WScript.Arguments.Count-1) | |
For i = 0 To WScript.Arguments.Count-1 | |
ArgList(i) = WScript.Arguments(i) | |
Next | |
Set WshShell = CreateObject("WScript.Shell") | |
WshShell.Run recentFile.Name & "\msedge.exe " & Join(ArgList, " "), 0 | |
Set WshShell = Nothing | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use
vbs
file to%PROGRAMFILESX86%\Microsoft\Edge\Application
or msedge installed to.msedge.vbs
instead ofmsedge.exe
Well, I'm considering running another chromium app instead of msedge. or not.