| View previous topic :: View next topic |
| Author |
Message |
kkkkk Master Cheater
Reputation: 0
Joined: 05 Jun 2006 Posts: 328 Location: Netherlands
|
Posted: Sat Mar 29, 2008 4:14 am Post subject: Shell VB 6.0 how to use? |
|
|
i searched, tried and get runtime error 5.
I just simply want to click he command button and it starts an .exe
thanx,.
_________________
Taekwondo is my life
Questions? *****hotmail.com u really would like to know..u had ur chance. too many on msn now.. |
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Sat Mar 29, 2008 4:36 am Post subject: |
|
|
Shell("C:/", vbNormalFocus)
That's for .Net but it shouldn't be too hard to translate to VB6.
_________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
kkkkk Master Cheater
Reputation: 0
Joined: 05 Jun 2006 Posts: 328 Location: Netherlands
|
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Sat Mar 29, 2008 5:59 am Post subject: |
|
|
Error '5' means access denied (lol I remember that evil number from back in the day).
Could you show us the code you're using?
Give this a go:
| Code: | Private Sub Command1_Click()
Call Shell("c:\file.exe", vbNormalFocus)
End Sub |
Make sure you edit values where needed.
Also, if you're using something like ZoneAlarm (or any other kernel hooking software) it may be automatically denying access to your application. So double check with that. (Many modern protection services do process monitoring).
|
|
| Back to top |
|
 |
kkkkk Master Cheater
Reputation: 0
Joined: 05 Jun 2006 Posts: 328 Location: Netherlands
|
Posted: Sat Mar 29, 2008 6:11 am Post subject: |
|
|
i have avg, dont think thats the problem. But when i use that code, i still get run time error 5
invaled procedure call or argument, and i did change c:\file.exe to an excisting file, do i have to mdo maybe something with the references? of a code that uses shell32.dll?
EDIT: already fixed, thanx !!
| Code: |
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_HIDE As Long = 0
Private Const SW_SHOWNORMAL As Long = 1
Private Sub Command1_Click()
ShellExecute 0&, "OPEN", "C:\ComboFix.txt", vbNullString, "C:\", SW_SHOWNORMAL
' ShellExecute Me.hwnd, "open", "c:\CSP_SNMP.vbs", "router1 Public", "C:\", 1
' c:\ = Destination Folder
End Sub
|
_________________
Taekwondo is my life
Questions? *****hotmail.com u really would like to know..u had ur chance. too many on msn now.. |
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Sat Mar 29, 2008 6:25 am Post subject: |
|
|
Ah okay, windows API is better anyway.
Upgrade to .NET sometime - trust me, better to do it earlier than later.
You can get the VB.NET Express edition free from Microsoft.
| Quote: | Hm, I was been wrong about Error 5 lol. Haven't used VB 6.0 in a long long time.
If that code didn't work, either the Command1 control doesn't exist, the VB6 installation may be corrupt, or there is an error some-where in the code when you modify it.
Are you trying this from an empty project? If not, start a new one and try it (create a button, double click it, add the code).
By default there should be 4 references:
Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
The components wont affect the Shell() code.
If all fails, you can try the API. If that fails, then something is wrong with your DLL setup. Re-install.
Also, what version of Windows are you using? Vista and XP both have process running protection, but in XP it's disabled by default.
One last thing to suggest, try launching other files. I know that's irrelevant to the error, but I found VB6 used to have internal errors which caused exceptions to come up as if it were end-user code. |
|
|
| Back to top |
|
 |
kkkkk Master Cheater
Reputation: 0
Joined: 05 Jun 2006 Posts: 328 Location: Netherlands
|
|
| Back to top |
|
 |
minium haxor Advanced Cheater
Reputation: 0
Joined: 03 Dec 2007 Posts: 82 Location: Faroe islands
|
Posted: Mon Jun 02, 2008 4:20 pm Post subject: |
|
|
if you add a text box that has the url then add to command
shell ("explorer.exe = text1.text")
_________________
|
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Mon Jun 02, 2008 7:51 pm Post subject: |
|
|
| minium haxor wrote: | if you add a text box that has the url then add to command
shell ("explorer.exe = text1.text") |
what the...
"text1.text" is a string, is it not...
Call shell ("explorer.exe " & text1.text)
_________________
Get kidnapped often. |
|
| Back to top |
|
 |
|