Skip to content

Instantly share code, notes, and snippets.

@shikishima
Last active December 5, 2023 09:53
Show Gist options
  • Select an option

  • Save shikishima/da9faaddf1e58cbf198bae6f8b2e0c32 to your computer and use it in GitHub Desktop.

Select an option

Save shikishima/da9faaddf1e58cbf198bae6f8b2e0c32 to your computer and use it in GitHub Desktop.
MS Edgeでプロファイルディレクトリを指定かつプロファイルを指定してコマンドラインで開く
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshFso = WScript.CreateObject("Scripting.FileSystemObject")
EDGE_EXE = WshShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe")
SHARE_DIR = WshShell.ExpandEnvironmentStrings("%HOME%\opt\share\")
EDGE_PROFILE_DIR = SHARE_DIR + "edge\profile\"
If Not WshFso.FolderExists(EDGE_PROFILE_DIR) Then
WshShell.Run("%ComSpec% /c md " + EDGE_PROFILE_DIR)
End If
WshShell.Run("""" + EDGE_EXE + """" + " --user-data-dir=" + EDGE_PROFILE_DIR + " --profile-directory=""Profile 1""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment