Skip to content

Instantly share code, notes, and snippets.

@BorysVrublevskyi
Created September 20, 2022 07:29
Show Gist options
  • Save BorysVrublevskyi/8e97b0c9a8f19c30aad3cb0dc5a12543 to your computer and use it in GitHub Desktop.
Save BorysVrublevskyi/8e97b0c9a8f19c30aad3cb0dc5a12543 to your computer and use it in GitHub Desktop.
Create Firefox shortcuts for multiple profiles
# Amount of needed Firefox profiles
$amount=2
# if ( Test-Path -Path "C:\Program Files\Mozilla Firefox\" ){
# curl.exe -O firefox.exe https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=uk
# }
# Create $amount profiles
while($num -lt $amount){
$num++
Start-Process -FilePath "firefox.exe" -WorkingDirectory "C:\Program Files\Mozilla Firefox\" -ArgumentList "-CreateProfile $num"
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$HOME\Desktop\Firefox-$num.lnk")
$Shortcut.TargetPath = "C:\Program Files\Mozilla Firefox\firefox.exe"
$Shortcut.WorkingDirectory = "C:\Program Files\Mozilla Firefox"
$Shortcut.Arguments = "-P $num"
$Shortcut.Save()
Write-Host "$num Shortcut and profile created"
}
# Create ProfileManager shortcut
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$HOME\Desktop\Firefox ProfileManager.lnk")
$Shortcut.TargetPath = "C:\Program Files\Mozilla Firefox\firefox.exe"
$Shortcut.WorkingDirectory = "C:\Program Files\Mozilla Firefox"
$Shortcut.Arguments = "-ProfileManager"
$Shortcut.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment