Visual basic mempunyai fungsi internal yang namanya Shell, fungsi ini bisa digunakan untuk :
1. Menjalankan file-file Excutible (.exe, .com, .bat de el el)
Contoh :
Private Sub Command1_Click()
Dim ret As Double
ret = Shell("notepad.exe", vbNormalFocus)
End Sub
2. Menjalankan file-file non Executible (.doc, .xls, .mdb, .txt de el el)
Contoh :
Private Sub Command1_Click()
Dim ret As Double
ret = Shell("notepad.exe c:\tes.txt", vbNormalFocus)
End Sub
dengan syarat file tes.txt sudah ada di drive c:
3. Mengakses fungsi-fungsi control panel
Misal kita akan menampilkan tab Background, Screen Saver dan Appearance yang ada di dialog Display. Contoh :
Private Sub Command1_Click()
Dim ret As Double
'displays the Background tab selected
ret = Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0", vbNormalFocus)
'displays the Screen Saver tab selected
'ret = Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1", vbNormalFocus)
'displays the Appearance tab selected
'ret = Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2", vbNormalFocus)
End Sub
Sumber command lainnya :
http://techsupt.winbatch.com/ts/T000001043001F3.htmlSelamat mencoba
