EDIT
If you want to perform any task at computer startup or based on an event this is very helpful
Back to the question
I have two questions:
I want some specific commands to be executed when I start command prompt.
e.g. cls
to clear my command prompt.
I want to execute some commands in a batch file and wait for the user to enter new commands (if any).
e.g. A batch file which will take the user to some specified folder and then wait for the user to rename/delete a file from the command prompt.
How can I do it?
I found my answer: I should use the /K
switch, using which I can enter a new command on the opened command prompt.
E.g. cmd /K cls
will open a command prompt for me and clear it. (Answer for question 1)
and
cmd /K MyBatchFile.bat
will start a command prompt, execute the batch file and stay on the command prompt and will not exit. (Answer for question 2).