473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

visual basic - button to run command or vb script (from same directory)

Hey there,

I have a .exe form I created with buttons to launch apps/scripts. The buttons are coded like so:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click 
  2.         Process.Start("C:\folder\file.exe") 
  3.     End Sub
  4.  
  5.  
This works great but now I want to run this .exe from a usb drive that has the folders\files.exe.

How would I change this code so the buttons will just launch the files from the same folder the .exe was launched from?
Aug 6 '14 #1
1 1331
Magkas
2
What i understand is you have more than .exe
Main .exe that will launch the other .exe
if i understand right
you can do it like this

Expand|Select|Wrap|Line Numbers
  1.  Dim MyPath As String
  2.         MyPath = IO.Directory.GetCurrentDirectory()
  3. Process.Start(MyPath & "\file.exe")
  4.  
Aug 7 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Fran Shescher | last post by:
If you have damaged any of your Visual Basic Professional 3.0 disks, replacements can be found here: http://www.geocities.com/peanutbutter88888 This is ONLY for LEGAL users of VB Pro 3 ......
0
by: Vineet | last post by:
Hi, can we extract visual studio 6.0 from visula studio .net? I mean can we install products like Visual Interdev, Visual Basic 6.0, VSS from visual studio .net cd? if so how? please reply...
0
by: rodneybauer1 | last post by:
hello: thanks in advance for any responses. i dont have a isp at home so have to use public library computer. will check this every couple days though. im using visual basic.Net windows XP with...
1
by: Tom Rahav | last post by:
Hello all! I develop application in Visual Basic .NET and ORACLE database. My question is how do I "send" script file to the database using visual basic .net. Other words, is there any way to...
3
by: Seigfried | last post by:
I can't find a way to do that anywhere on their site. Usually, you can get a CD for the cost of Shipping and Handling for their free downloads, but they don't seem to offer that option here.
1
by: karthik_c | last post by:
Hi, Anyone know how to pass a value textbox value from a VB6 activex control to vbscript. thanks in advance, karthik
0
by: Lisa Coal | last post by:
I am using the Insert database command several times in a visual basic macro. Every time I use the command in the macro the Select Data Source screen appears even though the source is set in the...
3
by: mrmwalter | last post by:
Hi, I need to create a GUI that has a form, on the form it asks for username. I therefore decided to use Visual Basic (not much experience_ On the form will be a button, how do I get this button...
1
risk32
by: risk32 | last post by:
I seem to be having a "brain fart" with the Shell() command for Visual Basic. Either that, or what I'm trying to can't be done and I'm just a noob for trying. Anyways, here's what I'm trying to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.