Basically I am trying to create an installer. I have an EXE file and I need to do the following steps through a bat file:
- create a folder at C:\Data
- Copy a file in C.\Data
- Create a folder inside C:\Program Files
- Copy exe file in C:\Program Files\My Project Folder
- Create shortcut to exe on Desktop
My code is as follows:
@echo off
if not exist "%PROGRAMFILES%\MyFolder" mkdir %PROGRAMFILES%\MyFolder
if not exist "C:\Data" mkdir C:\Data
copy /q /y ".\MyFile.exe" "%PROGRAMFILES%\MyFolder\MyFile.exe"
copy /q /y ".\MyFileDb.db" "C:\Data\MyFileDb.db"
The problem is that it shows "invalid path" error and says 0 files copied for MyFolder. However, it successfully creates Data folder and copies MyFileDb.db inside it.
Second problem is that I cannot figure out how to execute the Step 5 of my problem statement.