9 Replies - 4233 Views - Last Post: 08 November 2011 - 09:56 PM

#1 Xenon   User is offline

  • Connection failed
  • member icon

Reputation: 9
  • View blog
  • Posts: 1,595
  • Joined: 12-September 05

Starting an *.exe file from VB6 code

Posted 27 October 2005 - 12:54 AM

Description: take a form and add a command button to it, name it as cmdExec.This is a simple line of code to run a .exe application from VB6.
'I have made the code to run the calculator, which
' is present in every Windows Based PC.
'the command button  click() event triggers 
'the application to run.

'General Syntax is
RetVal = Shell([Pathname of EXE],[WindowStyle As vbAppWinStyle = vbMinimisedFocus])

'----------------CODE--------------------
Private Sub cmdExec_Click() ' cmdExec is the name of the command button on any form.
Dim RetVal
RetVal = Shell("C:WINDOWSSystem32calc.exe", 1)    ' Run Calculator.

End Sub
'---------------------------------------


Is This A Good Question/Topic? 0
  • +

Replies To: Starting an *.exe file from VB6 code

#2 denmont   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 06-November 07

Re: Starting an *.exe file from VB6 code

Posted 06 November 2007 - 06:22 PM

i would like to use a variable in place of a hard code file name. example: MyFile as String MyFile = "drawing.3dm" call shell("c:\rhino.exe c:\MyFile",3)
Was This Post Helpful? 0
  • +
  • -

#3 vishnudba   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 24-April 08

Re: Starting an *.exe file from VB6 code

Posted 24 April 2008 - 04:01 AM

Will it work for all exes
Was This Post Helpful? 0
  • +
  • -

#4 Jaalenn   User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 105
  • Joined: 17-November 08

Re: Starting an *.exe file from VB6 code

Posted 19 November 2008 - 11:00 PM

To answer this old question, yes. All you have to do is change RetVal = Shell("C:\WINDOWS\System32\calc.exe", 1) to RetVal = Shell("C:\File Location\Filename.exe", 1) Be sure to substitute the proper filepath for your exe.
Was This Post Helpful? 0
  • +
  • -

#5


Reputation: 0

Re: Starting an *.exe file from VB6 code

Posted 15 February 2009 - 05:02 PM

how will call my exe file from a cdrom? how will i use path to call my exe file in cdrom. sory poor english. please send to my email [email protected] thanks advance
Was This Post Helpful? 0

#6 Guest_*


Reputation:

Re: Starting an *.exe file from VB6 code

Posted 22 June 2009 - 03:28 AM

how do i can send "Ctrl+S" to an open exe file by sendkeys function?
Was This Post Helpful? 0

#7 avijit_g   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 22-July 09

Re: Starting an *.exe file from VB6 code

Posted 22 July 2009 - 04:06 AM

Thats Great, all the command are true & working with VB
Was This Post Helpful? 0
  • +
  • -

#8 shashankc   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-August 09

Re: Starting an *.exe file from VB6 code

Posted 18 August 2009 - 03:43 PM

what if i have to form any exe icon..it will also work
Was This Post Helpful? 0
  • +
  • -

#9 The Blue Phoenix   User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 84
  • Joined: 07-March 10

Re: Starting an *.exe file from VB6 code

Posted 18 March 2010 - 04:58 PM

Thanks this helped alot. I've been wandering a long time how to do this.
Was This Post Helpful? 0
  • +
  • -

#10 yasodhamohan   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 06-November 11

Re: Starting an *.exe file from VB6 code

Posted 08 November 2011 - 09:56 PM

thanks. but my problem is how can i specify my path of file(.csv) for to exe file bocz here we are specifying one arg of exe file.Pls help me
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1