I am writing a batch file to set up a few things on a new Ignition Gateway PC. The first thing it does is to restore a gateway backup. Following that, I want it to do things like open ports in the firewall and so on.
However, as soon as the gwcmd command executes (successfully), the batch file exits.
Relevant code:
@echo off
set dirpath=%~dp0
cd "C:/Program Files/Inductive Automation/Ignition"
echo Restoring gateway backup...
set /p gwname="Please enter a name for the Gateway: "
gwcmd --restore "%dirpath%\IgnitionGateway.gwbk" --name %gwname% --promptyes
pause
echo do other things...
The gwcmd command is successful - the gateway backup is restored with the specified name, and it restarts and is otherwise functional. However, as soon as the restore is complete, it very briefly flashes a message about being successful and closes the batch file. With the next line of the batch file being pause, I’m confident that it’s not code further down causing the issue.
Is this normal behaviour? Is there any way to fix it?
Edit: The batch file is being run as an administrator.
