dear all,
I want to run an exe from my vb.net windows form what is replacement of shell command(in vb 6.0) in vb.net
help appreciated !!
thanks & regards
ppcc
Printable View
dear all,
I want to run an exe from my vb.net windows form what is replacement of shell command(in vb 6.0) in vb.net
help appreciated !!
thanks & regards
ppcc
Simply this ,
VB Code:
Process.Start("notepad.exe")
actually, the "shell" command works too. Is it better to use the process.start?
Ofcourse , what better is , it's using managed code and no damn API .Quote:
Originally posted by thephantom
actually, the "shell" command works too. Is it better to use the process.start?
That code works fine if you are using an application for the filename. If you want to, say, open an excel file, with only the filename of the excel file, then this would be better
Code:Dim ss As Process
ss.StartInfo.FileName = theExcelFileName
ss.StartInfo.UseShellExecute = True
ss.StartInfo.RedirectStandardOutput = False
ss.Start()
How would that work better? I can send "business.xls" (I'm not sure of the excel extension, lets pretend it is .xls if I am wrong) to Process.Start() and it opens the file into excel.Quote:
Originally posted by But_Why
That code works fine if you are using an application for the filename. If you want to, say, open an excel file, with only the filename of the excel file, then this would be better
Code:Dim ss As Process
ss.StartInfo.FileName = theExcelFileName
ss.StartInfo.UseShellExecute = True
ss.StartInfo.RedirectStandardOutput = False
ss.Start()
I think it's goin to lead to the same
It's the same but longer , better to use the static Process class with only one line of code .Quote:
Originally posted by But_Why
That code works fine if you are using an application for the filename. If you want to, say, open an excel file, with only the filename of the excel file, then this would be better
Code:Dim ss As Process
ss.StartInfo.FileName = theExcelFileName
ss.StartInfo.UseShellExecute = True
ss.StartInfo.RedirectStandardOutput = False
ss.Start()
thank u genious
regards
ppcc