1
0
mirror of https://github.com/yorukot/superfile.git synced 2025-02-06 10:02:21 +00:00

Create cd_on_quit.ps1

This commit is contained in:
nonepork 2024-05-20 18:39:11 +08:00 committed by GitHub
parent 3d6dd23511
commit f82d93b77f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

15
cd_on_quit/cd_on_quit.ps1 Normal file
View File

@ -0,0 +1,15 @@
function spf() {
param (
[string[]]$Params
)
$spf_location = [Environment]::GetFolderPath("LocalApplicationData") + "\Programs\superfile\spf.exe"
$SPF_LAST_DIR_PATH = [Environment]::GetFolderPath("LocalApplicationData") + "\superfile\lastdir"
& $spf_location @Params
if (Test-Path $SPF_LAST_DIR_PATH) {
$SPF_LAST_DIR = Get-Content -Path $SPF_LAST_DIR_PATH
Invoke-Expression $SPF_LAST_DIR
Remove-Item -Force $SPF_LAST_DIR_PATH
}
}