- <#*,:&cls
- @echo off
- cd /d "%~dp0"
- powershell -C "Set-Location -LiteralPath ([Environment]::CurrentDirectory);. ([ScriptBlock]::Create((Get-Content -LiteralPath \"%~f0\" -ReadCount 0 | Out-String)))"
- pause
- exit /b
- #>
- ($psoPhotoShop = Get-ChildItem -Path ('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
- 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall',
- 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
- 'HKCU:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall') -ErrorAction SilentlyContinue | `
- Get-ItemProperty -Name DisplayName, DisplayVersion, InstallLocation, UninstallString -ErrorAction SilentlyContinue |`
- Where-Object { $_.DisplayName -like '*photoshop*' } | Select-Object -First 1
- )
- if ($psoPhotoShop -and -not [string]::IsNullOrWhiteSpace($psoPhotoShop.InstallLocation)) {
- Copy-Item -Path B -Destination $psoPhotoShop.InstallLocation -Recurse -Verbose
- } else {
- '找不到phtoshop安装路径'
- }
复制代码 可能需要以管理员身份运行 bat. 保存为ANSI编码 |