@echo off chcp 65001 > nul title أداة إنشاء أيقونة برنامج المحامي على سطح المكتب color 0B echo ================================================================ echo برنامج المحامي - نظام إدارة مكاتب المحاماة echo أداة إنشاء أيقونة واختصار البرنامج على سطح المكتب echo ================================================================ echo. echo جارٍ البحث عن تثبيت برنامج المحامي على جهازك وإنشاء الأيقونة... echo. powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$ws = New-Object -ComObject WScript.Shell; " ^ "$desktop = [Environment]::GetFolderPath('Desktop'); " ^ "$shortcutPath = Join-Path $desktop 'المحامي.lnk'; " ^ "$targetFound = $false; " ^ "$app = Get-StartApps | Where-Object { $_.Name -like '*المحامي*' -or $_.Name -like '*AlMohamy*' } | Select-Object -First 1; " ^ "if ($app) { " ^ " $s = $ws.CreateShortcut($shortcutPath); " ^ " $s.TargetPath = 'explorer.exe'; " ^ " $s.Arguments = 'shell:AppsFolder\' + $app.AppID; " ^ " $s.Description = 'المحامي - نظام إدارة مكاتب المحاماة والقضايا'; " ^ " $s.Save(); " ^ " $targetFound = $true; " ^ "} else { " ^ " $searchPaths = @( " ^ " (Join-Path $env:LOCALAPPDATA 'Programs\AlMohamy\AlMohamy.exe'), " ^ " (Join-Path $env:ProgramFiles 'AlMohamy\AlMohamy.exe'), " ^ " (Join-Path ${env:ProgramFiles(x86)} 'AlMohamy\AlMohamy.exe') " ^ " ); " ^ " foreach ($p in $searchPaths) { " ^ " if ($p -and (Test-Path $p)) { " ^ " $s = $ws.CreateShortcut($shortcutPath); " ^ " $s.TargetPath = $p; " ^ " $s.WorkingDirectory = Split-Path $p; " ^ " $s.Description = 'المحامي - نظام إدارة مكاتب المحاماة والقضايا'; " ^ " $s.Save(); " ^ " $targetFound = $true; " ^ " break; " ^ " } " ^ " } " ^ "} " ^ "if ($targetFound) { " ^ " Write-Host '====================================================' -ForegroundColor Green; " ^ " Write-Host ' تم إنشاء أيقونة برنامج المحامي على سطح المكتب بنجاح!' -ForegroundColor Green; " ^ " Write-Host '====================================================' -ForegroundColor Green; " ^ " Write-Host 'مسار الأيقونة: ' $shortcutPath -ForegroundColor Cyan; " ^ "} else { " ^ " Write-Host 'تنبيه: لم يتم العثور على البرنامج مثبت مسبقاً.' -ForegroundColor Yellow; " ^ " Write-Host 'إذا قمت بتثبيته للتو، يرجى فتح البرنامج أول مرة من قائمة ابدأ (Start) وسيتم إنشاء الأيقونة تلقائياً.' -ForegroundColor Yellow; " ^ "} " echo. echo اضغط أي مفتاح للإغلاق... pause > nul