'I have a batch script that locates the path of a file in the system and I want create a permanent alias with that path

@echo off
set file=
for %%f in (..\..\*.ps1) do (
    set file=%%f
)
CALL :NORMALIZEPATH %file%
echo powershell %RETVAL% > "location.txt"
@REM %path%
:: ============= FUNCTIONS =====================
:NORMALIZEPATH
    SET RETVAL=%~f1
    EXIT /B

this script locates a .ps1 file in the system indipendently of where is located but I want to use the path to make a permanent alias in the system. I tryied using doskey but is only temporary. How can I do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source