กระดานแสดงความคิดเห็น
Home
Contents
Articles
Quiz
Members
Sponsor
Print-friendly
MENU
ปรับปรุง : 2566-10-15 (กระดานแสดงความคิดเห็น)
เว็บเพจหน้านี้สำหรับผู้ดูแลเท่านั้น
รหัส secure
=>
นำตัวอักษร สีขาวบนพื้นแดง มาป้อนในช่องนี้
edit_topic_password =>
<center><table width=90% border=0 bgcolor=#000080><tr><td><font color=white size=4>shell in vb for calling dos command</td></tr></table><table width=90% bordercolor=#000080 border=1><tr><td bgcolor=white><br>from http://www.vbcity.com/forums/faq.asp?fid=9&cat=Shell<br /> <br /> <br /> Public Declare Function ShellExecute _ <br /> Lib "shell32.dll" Alias "ShellExecuteA" ( _ <br /> ByVal hwnd As Long, _ <br /> ByVal lpOperation As String, _ <br /> ByVal lpFile As String, _ <br /> ByVal lpParameters As String, _ <br /> ByVal lpDirectory As String, _ <br /> ByVal nShowCmd As Long) As Long<br /> <br /> ShellExecute hwnd, "open", "C:\Netlog.txt", vbNullString, "C:\", 1 <br /> ' Obviously, the file must exist at that location for this to work. <br /> <br /> ShellExecute hwnd, "open", "C:\windows\script.doc", vbNullString, "C:\", 3 <br /> ' (You can type the above all on one line of code - minus the underscore)<br /> <br /> ShellExecute hwnd, "open", "C:\acrobat3\reader\acrobat.pdf", vbNullString, "C:\", 1 <br /> ' (You can type the above all on one line of code - minus the underscore)<br /> <br /> <br /> Shell ("c:\windows\calc.exe") <br /> <br /> Shell ("c:\iridium.exe") ' <br /> * Obviously, assuming you have such a file on your C Drive. <br /> <br /> Shell ("c:\RunMe.com") <br /> '* As above <br /> <br /> Shell ("c:\windows\help\pingnum.bat") <br /> <br /> Dim RetVal as Double <br /> <br /> ' To run a file in Normal WindowState, use 1 or vbNormalFocus <br /> RetVal = Shell("c:\windows\notepad.exe", 1) <br /> 'or <br /> RetVal = Shell("c:\MyApp.exe", vbNormalFocus) <br /> <br /> ' To open minimized, use 6 or vbMinimizedFocus <br /> RetVal = Shell("c:\windows\help\pingnum.bat", vbMinimizedFocus) <br /> <br /> ' And, for Maximized, use 3 or vbMaximizedFocus <br /> RetVal = Shell("C:\Windows\PBrush.exe", 3)<br /> <br /> <br /> <br><br></td></tr><tr><td align=right bgcolor=black><font color=white><small><b>จากคุณ :</b> burin <a href=mailto:></a><a title='202.29.78.18'>.</a><br> 11:13pm (7/12/05)</font></td></tr></table></center>