3 Replies - 3113 Views - Last Post: 18 March 2013 - 06:42 AM Rate Topic: -----

#1 terror2012  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-March 13

Make a project in VB to run other .exe

Posted 18 March 2013 - 04:40 AM

Hello. I have a question. What code I need to pus in VB project to run a .exe. This .exe will be in directory near .exe maked in VB. I tried
 Process.Start ("C:/MyDirectory/My.exe") 
, but if my friend get it and put in another location (project exe + My.exe) the file maked in VB will not work. I need for this file to get directory there is it and run .exe I declared. Thanks.
Is This A Good Question/Topic? 0
  • +

Replies To: Make a project in VB to run other .exe

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3479
  • View blog
  • Posts: 11,819
  • Joined: 12-December 12

Re: Make a project in VB to run other .exe

Posted 18 March 2013 - 04:59 AM

It depends where the .exe will be located:

SpecialDirectories such as MyDocuments
the current working directory
Application.StartupPath
..there are others.

This post has been edited by andrewsw: 18 March 2013 - 04:59 AM

Was This Post Helpful? 0
  • +
  • -

#3 terror2012  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-March 13

Re: Make a project in VB to run other .exe

Posted 18 March 2013 - 05:36 AM

I need to write
 Public Shared Function GetCurrentDirectory As String        Process.Start("GetCurrentDirectory/My.exe") 
?
Thanks
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3479
  • View blog
  • Posts: 11,819
  • Joined: 12-December 12

Re: Make a project in VB to run other .exe

Posted 18 March 2013 - 06:42 AM

View Postterror2012, on 18 March 2013 - 05:36 AM, said:

I need to write
 Public Shared Function GetCurrentDirectory As String        Process.Start("GetCurrentDirectory/My.exe") 
?
Thanks

What? There is already a method called GetCurrentDirectory, read the second link I provided.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1