justjeffindc
New member
- Local time
- 6:31 AM
- Messages
- 28
I need to be able to start a process and have it wait for the process to complete. For example, if I run the below:
start-process notepad -wait
[System.Windows.Forms.MessageBox]::Show("Started running.")
Notepad opens, and after I close it the message box pops up. This is exactly what I want to see except that the process I actually need to run needs to run as administrator. So I run this instead:
start-process notepad -verb runAs -wait
[System.Windows.Forms.MessageBox]::Show("Started running.")
Now Notepad opens and the message displays immediately.
What am I doing wrong?
start-process notepad -wait
[System.Windows.Forms.MessageBox]::Show("Started running.")
Notepad opens, and after I close it the message box pops up. This is exactly what I want to see except that the process I actually need to run needs to run as administrator. So I run this instead:
start-process notepad -verb runAs -wait
[System.Windows.Forms.MessageBox]::Show("Started running.")
Now Notepad opens and the message displays immediately.
What am I doing wrong?
My Computer
- Computer Manufacturer/Model Number
- Homebuilt
- OS
- Windows 7 Professional 64 bit