[RESOLVED] Start Desktop Program (How is it done ?? Help pls )
Hi guys I have a question
I'm making a like a remote control for my desktop now, I have a Program called My Radio.exe
I would like to Know how I can asign My Radio.exe to my button
Also if I comopile the program if other person downloads ( the path has to match to Program it self )
So To make it more clear this is what I want
I created a Folder on my desktop called ( My Remote )
Inside that folder there are 2 .exe programs
1 called MyRemote
2 called MyRadio
My question is how can I run MyRadio in my VB6 App by click of the button ( I know I have to put in path ) but will path match to other users pc ? how can I do it so my program is loaded from my ( Or OPersons folder reardless of the foldier location on PC )
If you guys know what I mean :)
Re: Start Desktop Program (How is it done ?? Help pls )
Hi,
You could use the shell command:
Code:
shell ("app.path &"/"& myradio.exe")
Put that code inside the command button!
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Nightwalker83
Hi,
You could use the shell command:
Code:
shell ("app.path &"/"& myradio.exe")
Put that code inside the command button!
I tried that and I got an error
Runtime error 13 type mismatch ( and it crashed my project )
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Breez
I tried that and I got an error
Runtime error 13 type mismatch ( and it crashed my project )
Try removing the end quotes!
Re: Start Desktop Program (How is it done ?? Help pls )
NBow it seas varebol not defined here is the code
Code:
Private Sub UserButtonz3_Click()
Shell (App.Path & " / " & MyRadio.exe)
End Sub
Re: Start Desktop Program (How is it done ?? Help pls )
Code:
Private Sub UserButtonz3_Click()
Shell (App.Path & " / " & "MyRadio.exe")
End Sub
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Nightwalker83
Code:
Private Sub UserButtonz3_Click()
Shell (App.Path & " / " & "MyRadio.exe")
End Sub
Runtime error '5'
Invalid Procedure Call or argument
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Nightwalker83
Code:
Private Sub UserButtonz3_Click()
Shell (App.Path & " / " & "MyRadio.exe")
End Sub
You shouldn't have spaces before and after the backslash.
Code:
Shell App.Path & "\MyRadio.exe", vbNormalFocus
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Edgemeal
You shouldn't have spaces before and after the backslash.
Code:
Shell App.Path & "\MyRadio.exe", vbNormalFocus
Runtime error 53
File Not Found
Can you please guys note that This Radio has to start regardless of its location on the computer
So if its located on my desktop and lets say my girlfriend puts it in her documents when she doenloads ( it will not look for it in desktop but find it in any location of any ones pc who ever downloads my file ) not everyone will put the folder on desktop every one puts in in different location ( thats why I will incluide radio player in folder
If you guys know what I mean ?
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Breez
Runtime error 53
File Not Found
Can you please guys note that This Radio has to start regardless of its location on the computer
If the remote and the radio are part of the same setup they shouldn't be in two separate locations.
Try putting the radio.exe in the same folder as the remote.exe an see if the code works.
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Nightwalker83
If the remote and the radio are part of the same setup they shouldn't be in two separate locations.
Try putting the radio.exe in the same folder as the remote.exe an see if the code works.
Thanks that work so now when I zip up folder it will work regardless of the Folder location ?
Thanks By the way :)
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Breez
Thanks that work so now when I zip up folder it will work regardless of the Folder location ?
Yes, it will work as long as the remote.exe and radio.exe are in the same folder.
Edit:
If you have resolved the problem please add "Resolved" to the thread title.
Re: Start Desktop Program (How is it done ?? Help pls )
Quote:
Originally Posted by Nightwalker83
Yes, it will work as long as the remote.exe and radio.exe are in the same folder.
ok another question now I have a program in my programs folder ( by Default everyone that installs this program goes to this path
C:\Program Files\Teamspeak2_RC2\TeamSpeak.exe
How can I run above App from it's location ( like I said any one that downloads this will have it in above location )
So button will need to go to
C:\Program Files\Teamspeak2_RC2\TeamSpeak.exe
How can I achive that ? Thanks again propz add it
I used this command
Code:
Private Sub UserButtonz2_Click()
Shell App.Path & "C:\Program Files\Teamspeak2_RC2\TeamSpeak.exe"
End Sub
and that dident work :(
Re: Start Desktop Program (How is it done ?? Help pls )
Code:
Shell App.Path & "/" & "TeamSpeak.exe"
App.path = "C:\Program Files\Teamspeak2_RC2\" or wherever you install the program.
Re: Start Desktop Program (How is it done ?? Help pls )
Code:
Shell "C:\Program Files\Teamspeak2_RC2\TeamSpeak.exe"
Re: Start Desktop Program (How is it done ?? Help pls )
Thanks to both of you propz add it to both koolsid tip has worked :) thanks again for both of u :)