1

I'd like to run this command net start "PTV LOXANE xDataServer 1.4.1.067" using Start-Process in powershell with admin rights. My problem is how to give the quote to ArgumentList. I've tried this but it doesn't work

Start-Process net -ArgumentList "stop \"PTV LOXANE xDataServer 1.4.1.067\"" -Verb runas -wait -NoNewWindow -PassThru
Lohiki
  • 41
  • 6

1 Answers1

1

I've found how to do it. You must double the quotes: Start-Process net -ArgumentList "start ""PTV LOXANE xDataServer 1.4.1.067""" -wait -PassThru -Verb runas

Now I've got a second question. How can I run this command when calling powershell ? This doesn't work:

powershell -Command 'Start-Process net -ArgumentList "start ""PTV LOXANE xDataServer 1.4.1.067""" -wait -PassThru -Verb runas'
Lohiki
  • 41
  • 6