|
-
Mar 31st, 2005, 11:26 AM
#1
including arguments with System.Diagnostics.Process.Start.... [resolved]
I can do
VB Code:
System.Diagnostics.Process.Start("C:\windows\system32\shutdown.exe")
but this returns a file not found error
VB Code:
System.Diagnostics.Process.Start("C:\windows\system32\shutdown.exe -r")
How do I include the switches at the end of the file name when using Process.Start?
thanks
kevin
Last edited by kebo; Mar 31st, 2005 at 12:48 PM.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Mar 31st, 2005, 11:31 AM
#2
Hyperactive Member
Re: including arguments with System.Diagnostics.Process.Start command line exe
Create a process object, then fill in the ProcessInfo data and start it that way. I don't have the compiler here but you need something like this:
VB Code:
Dim pShutdown as Process
pShutdown.ProcessInfo.??? '<<< Don't know what it's called, but it's in there somewhere
pShutdown.Start
-
Mar 31st, 2005, 11:42 AM
#3
Re: including arguments with System.Diagnostics.Process.Start command line exe
thanks
here's what I got:
VB Code:
Dim p As New Process
p.StartInfo.FileName = "C:\windows\system32\shutdown.exe -r"
p.Start()
but I get the same result:
The system cannot find the file specified
anyone/anything else?????
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Mar 31st, 2005, 11:54 AM
#4
Hyperactive Member
Re: including arguments with System.Diagnostics.Process.Start command line exe
There should be another member of "StartInfo" that controls the command line arguments called "Arguments" or something similar. You need to add:
VB Code:
p.StartInfo.Arguments = "-r"
to the code above, and remove the argument from the filename property. It should look like this:
VB Code:
Dim p As Process
p.StartInfo.Filename = "C:\windows\system32\shutdown.exe"
p.StartInfo.Arguments = "-r"
p.Start
-
Mar 31st, 2005, 12:47 PM
#5
Re: including arguments with System.Diagnostics.Process.Start command line exe
that's the ticket. thanks
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|