Save batch file path to local harddisk

Posted by Brian on Stack Overflow See other posts from Stack Overflow or by Brian
Published on 2010-04-08T15:05:31Z Indexed on 2010/04/08 15:13 UTC
Read the original article Hit count: 302

Filed under:
|

Hi, I have a batch file that is Run when a selfextraction file is executed. The self extracted files must be copied to to specefic place on the harddisc. In the batch file the user is asked where the path is (if it's not located the default place) Part of the batch file:

@ECHO OFF

IF EXIST "C:\Program Files\program\program.exe". (

    set PROGRAMPATH=C:\Program Files\

) ELSE (

    echo Program folder was not found. Please enter the path for Program

    set /p PROGRAMPATH=Path:
)

echo Copying data to "%PROGRAMPATH%"...


copy /Y "*.txt" "%PROGRAMPATH%"

Now for my question. If a user then enters a new path, is it possible to save that path. So when he executes the self extraction packagde again, it could remember that new path?

© Stack Overflow or respective owner

Related posts about batch

Related posts about file