@echo off
net session >nul 2>&1
if %errorLevel% neq 0 (
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit /b
)

  echo "fixing most common issue"
  
SETLOCAL ENABLEEXTENSIONS
SET "TARGET_DIR=%~dp0"
SET "USERNAME=%USERNAME%"

takeown /F "%TARGET_DIR%" /R /D Y
icacls "%TARGET_DIR%" /grant "%USERNAME%:F" /T

echo "done"
