Created
September 20, 2022 07:29
-
-
Save BorysVrublevskyi/8e97b0c9a8f19c30aad3cb0dc5a12543 to your computer and use it in GitHub Desktop.
Create Firefox shortcuts for multiple profiles
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
# 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