0

I am trying to automate a scenario, where i need to open a cmd prompt with cd to path, which i am able to achieve with:

Start-Process -FilePath "cmd.exe" -ArgumentList "/K cd /d C:\Program Files (x86)\Folder\" -Verb "runas"

Further, i need to execute a cmd "ab.exe -i name url" in the cmd prompt opened as a result of executing the above code. I am trying this via powershell scripting.

1 Answer 1

2

You can concatenate multiple commands using & or && operator. The latter only runs the 2nd command if the first one was successfull.

-ArgumentList "/K cd /d C:\Program Files (x86)\Folder\ && ab.exe -i name url"
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.