1

I need to run two commands, followed by more commands dependant on the outcome. What I usually do is just open two powershell consoles, type the commands in there, and enter further commands if necessary. I want to make a script that simplifies this process and removes all the copy pasting. Right now I have a batch file with the following inside:

start powershell "cd 'C:\Program Files\folder' ; ./program.exe argument"
start powershell "cd 'C:\Program Files\otherfolder' ; python ./pythonscript.py"

The issue with this is that once the scripts are done the windows are closed and I cannot interact with them. What I need is to not only see the output but also have a PS console open so I could perform further actions in those directories. That is to perfectly replicate how it worked when I did it manually. Any ideas?

4
  • 6
    -NoExit? Commented Jun 27, 2018 at 16:17
  • @PetSerAl beautiful champ. Add this as an answer and I'll accept it. Commented Jun 27, 2018 at 16:19
  • 1
    Have you tried utilising Start's /D option? (Start /? at the Command Prompt for more information.) Commented Jun 27, 2018 at 16:42
  • @Compo I haven't, but -NoExit is perfect for my use case Commented Jun 27, 2018 at 17:18

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.