-
March 10th, 2011, 09:18 PM
#1
[RESOLVED] Can't launch particular program on button click
I hope I'm in the right place, lol. I am trying to activate Rosetta Stone on a button click (button4). It opens but gives me an error. 2123 is the error code. I guess this may require knowledge of Rosetta Stone more than VB but I have found no luck searching google. Is there alternative code to what I'm trying to do?
Code:
Public Class Form1
Private Sub Chrome_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chrome.Click
System.Diagnostics.Process.Start("chrome.exe")
End Sub
Private Sub CCleaner_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CCleaner.Click
System.Diagnostics.Process.Start("ccleaner.exe")
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rappelz.Click
System.Diagnostics.Process.Start("C:\gPotato\Rappelz\Launcher.exe")
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
System.Diagnostics.Process.Start("C:\Program Files\Rosetta Stone\Rosetta Stone Version 3\RosettaStoneVersion3.exe")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
System.Diagnostics.Process.Start("taskmgr.exe")
End Sub
Private Sub Calc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Calc.Click
System.Diagnostics.Process.Start("calc.exe")
End Sub
End Class
-
March 10th, 2011, 11:29 PM
#2
Re: Can't launch particular program on button click
Look at the properties of the button, to see what the parameters are
-
March 11th, 2011, 01:06 AM
#3
Re: Can't launch particular program on button click
-
March 11th, 2011, 07:44 PM
#4
Re: Can't launch particular program on button click
Okay, sorry it took so long to respond. What am I supposed to be looking at?
-
March 11th, 2011, 08:44 PM
#5
Re: Can't launch particular program on button click
Right-click on the start menu item, and examine the properties for %1 or something at the end.
-
March 11th, 2011, 11:06 PM
#6
Re: Can't launch particular program on button click
Do you mean outside of VB? If so, I looked at both and I do not see a 1% or any % sign anywhere
-
March 11th, 2011, 11:33 PM
#7
Re: Can't launch particular program on button click
Might not have permission to see that folder. Post the exact path
-
March 11th, 2011, 11:41 PM
#8
Re: Can't launch particular program on button click
Originally Posted by dglienna
Might not have permission to see that folder. Post the exact path
Here on the forum or in the program? I already did in the program.
In case you mean here,
C:\Program Files\Rosetta Stone\Rosetta Stone Version 3\RosettaStoneVersion3.exe
I'm assuming you mean in the program so I feel kinda dumb posting that
-
March 12th, 2011, 10:10 AM
#9
Re: Can't launch particular program on button click
Try to use "shell:
Private Sub Chrome_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chrome.Click
shell ("chrome.exe")
End Sub
Private Sub Calc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Calc.Click
shell ("calc.exe")
End Sub
-
March 12th, 2011, 01:00 PM
#10
Re: Can't launch particular program on button click
I already tried that. The same thing happens
-
March 12th, 2011, 02:14 PM
#11
Re: Can't launch particular program on button click
Well, there has to be some command-line switch. CD to the folder and find the name of the .exe
then, execute the command
Code:
myProgramName.exe /?
To see if there are command-line options.
-
April 2nd, 2011, 04:25 PM
#12
Re: Can't launch particular program on button click
Oh wow I forgot about this thread. oops... I remembered because I have the same problem again.
dglienna, That may have worked but I have changed how the program works. The user selects the file using "openfiledialog.showdialog()"
-
April 6th, 2011, 04:43 AM
#13
Re: Can't launch particular program on button click
Try setting the working directory before launching otherwise it will default to system:
Sometimes, certain applications- have problems when running without a specified working directory.
Code:
dim process as new process()
process.StartInfo.UseShellExecute = False
process.StartInfo.FileName="C:\Program Files\Rosetta Stone\Rosetta Stone Version 3\RosettaStoneVersion3.exe"
process.StartInfo.workingdirectory=io.path.getdirectoryname("C:\Program Files\Rosetta Stone\Rosetta Stone Version 3\RosettaStoneVersion3.exe")
process.start
Last edited by StriderH2; April 6th, 2011 at 02:55 PM.
-
April 6th, 2011, 12:38 PM
#14
Re: Can't launch particular program on button click
I'm getting, "Reference to a non-shared members requires an object reference".
-
April 6th, 2011, 02:12 PM
#15
Re: Can't launch particular program on button click
on which line do get this error?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|