0

Basically I just want the batch file to restart and resume the batch file script. (I'm using Bat to Exe converter, so some script is going to be changed) My script is on GitHub and is long, so I'm going to show the short version (actually the first code is just an example because PKA has Windows 8.1, 10, and 11, and all the editions):

pause
start "" "%~dp0PKA_files\bin\activatefiles\exe\w11\pro11.exe
cls
goto restart

(a lot of code goes here)

:restart
exit
start "Product Key Activator" "%~dp0PKA64.bat"
goto pryc

The resume point code will be goto pryc.

Stephen
  • 27
  • 7
  • Hi and welcome here ! So, as far as I understand, the `:restart` section only `exit`s the batch ? ;) – Philippe Sep 29 '21 at 04:37
  • So I didn't understand the process, because for me, the `exit` instruction... exits the batch ;) Doesn't it ? – Philippe Sep 29 '21 at 06:33
  • So, `exit` stops the main batch, ie `start "Product Key Activator" "%~dp0PKA64.bat"` and `goto start` are never processed. But it's early in the morning for me, and perhaps I stuck on something ;) – Philippe Sep 29 '21 at 07:02
  • In my opinion, the `exit` instruction is useless and you would try to remove it. – Philippe Sep 29 '21 at 07:10
  • By "to close the program", do you mean to kill a previously launched (external) process ? – Philippe Sep 29 '21 at 07:16
  • 1
    The `exit` command quits the batch file and even terminates the shell, you should better use `exit /B` to just quit the script. Anyway, why do you want to quit and relaunch it after all? why not just using `goto :start`? – aschipfl Sep 29 '21 at 08:32
  • Please [edit] your post to update and clarify your question rather than spreading several comments here! Thank you! – aschipfl Sep 29 '21 at 12:21

1 Answers1

0

Why don't you separate the codes a little bit, separate this code and put it in a new file

:restart
start "Product Key Activator" "%~dp0PKA64.bat"
exit

Now put in the dp0PKA64.bat file this code and put the contents of the code

goto pryc
ahmed
  • 86
  • 5