43 lines
1.8 KiB
PowerShell
43 lines
1.8 KiB
PowerShell
$link = "C:\Users\sahrk\AppData\Roaming\MetaQuotes\Terminal\FB9A56D617EDDDFE29EE54EBEFFE96C1\MQL5\Experts\Shared Projects\VizionAI-EA"
|
|
$vbs = "C:\Users\sahrk\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\VizionAI-RepoWatcher.vbs"
|
|
$eaGit = "C:\Users\sahrk\AppData\Roaming\MetaQuotes\Terminal\FB9A56D617EDDDFE29EE54EBEFFE96C1\MQL5\Shared Projects\VizionAI-Trading\VizionAI-Trading-Repo\VizionAI-EA\.git"
|
|
|
|
# 1. Kill any running watcher powershell processes
|
|
Get-Process powershell -ErrorAction SilentlyContinue | ForEach-Object {
|
|
$cmd = (Get-CimInstance Win32_Process -Filter "ProcessId=$($_.Id)").CommandLine
|
|
if ($cmd -like "*watch-vizion-repos*") {
|
|
Stop-Process -Id $_.Id -Force
|
|
Write-Host "Stopped watcher (PID $($_.Id))"
|
|
}
|
|
}
|
|
|
|
# 2. Disable the startup VBS
|
|
if (Test-Path $vbs) {
|
|
Rename-Item $vbs "$vbs.disabled" -Force
|
|
Write-Host "Startup VBS disabled."
|
|
} else {
|
|
Write-Host "Startup VBS already absent."
|
|
}
|
|
|
|
# 3. Remove the junction (delete the junction entry, NOT the target files)
|
|
if (Test-Path $link) {
|
|
$item = Get-Item $link -Force
|
|
$item.Delete()
|
|
Write-Host "Junction removed: Experts\Shared Projects\VizionAI-EA"
|
|
} else {
|
|
Write-Host "Junction already absent."
|
|
}
|
|
|
|
# 4. Remove our .git from VizionAI-EA so MT5 owns git
|
|
if (Test-Path $eaGit) {
|
|
Remove-Item $eaGit -Recurse -Force
|
|
Write-Host "Removed .git from VizionAI-EA (MT5 will own git sync)"
|
|
} else {
|
|
Write-Host ".git already absent from VizionAI-EA."
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "Done. MT5 now manages Shared Projects freely."
|
|
Write-Host ""
|
|
Write-Host "Experts\Shared Projects:"
|
|
Get-ChildItem "C:\Users\sahrk\AppData\Roaming\MetaQuotes\Terminal\FB9A56D617EDDDFE29EE54EBEFFE96C1\MQL5\Experts\Shared Projects" -ErrorAction SilentlyContinue | Select-Object Name, Attributes | Format-Table -AutoSize
|