# PowerShell script to create Chrome shortcuts for specific URLs # Define variables $labelsFile = "labels.txt" $faviconFile = "logo.ico" $chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe" $baseUrl = "https://seller.hepsiglobal.com/" $baseUserDataDir = "D:\HepsiSeller-Data" # Check if Chrome executable exists if (-not (Test-Path $chromePath)) { Write-Error "Chrome executable not found: $chromePath" exit 1 } # Check if stores.txt file exists if (-not (Test-Path $labelsFile)) { Write-Error "stores.txt file not found: $labelsFile" exit 1 } # Check if favicon.ico file exists if (-not (Test-Path $faviconFile)) { Write-Error "favicon.ico file not found: $faviconFile" exit 1 } # Read store names $stores = Get-Content $labelsFile # Create shortcuts for each store foreach ($store in $stores) { # Skip empty lines if ([string]::IsNullOrWhiteSpace($store)) { continue } # Create user data directory path $userDataDir = Join-Path $baseUserDataDir $store # Create user data directory if it doesn't exist if (-not (Test-Path $userDataDir)) { New-Item -ItemType Directory -Path $userDataDir -Force | Out-Null } # Copy logo.ico to user data directory $localFaviconPath = Join-Path $userDataDir "logo.ico" if (Test-Path $faviconFile) { Copy-Item -Path $faviconFile -Destination $localFaviconPath -Force } # Create shortcut $shortcutName = "$store.lnk" $shortcutPath = Join-Path $PWD $shortcutName # Create WScript.Shell object $shell = New-Object -ComObject WScript.Shell # Create shortcut object $shortcut = $shell.CreateShortcut($shortcutPath) # Set shortcut properties $shortcut.TargetPath = $chromePath $shortcut.Arguments = "--user-data-dir=`"$userDataDir`" --app=`"$baseUrl`"" $shortcut.IconLocation = "$localFaviconPath,0" $shortcut.Save() Write-Output "Created shortcut: $shortcutName" } Write-Output "All shortcuts created successfully."