|
-
Jan 29th, 2003, 12:28 AM
#1
Thread Starter
Lively Member
Execute EXE file
How do I execute an .exe file using VB code?
-
Jan 29th, 2003, 12:45 AM
#2
Frenzied Member
-
Jan 29th, 2003, 12:52 AM
#3
Sleep mode
Originally posted by Lunatic3
Use Shell function
I think Shell and API ways are old stuff to run exe . anyways , here's .NET way
VB Code:
System.Diagnostics.Process.Start("notepad.exe")
try it ...
-
Jan 29th, 2003, 01:13 AM
#4
Frenzied Member
Thanks Pirate.
Shell synstax is :
Public Function Shell( _
ByVal Pathname As String, _
Optional ByVal Style As AppWinStyle = AppWinStyle.MinimizedFocus, _
Optional ByVal Wait As Boolean = False, _
Optional ByVal Timeout As Integer = -1 _
) As Integer
Is there an easy way to define optional arguments of Shell- Style,Wait and Timeout- for Process.Start ?
-
Jan 29th, 2003, 02:44 AM
#5
Thread Starter
Lively Member
exe with arguments?
i have a arj.exe file
my command is
arj a a:test c:test.mdb -va -y
how do i insert this arguments in the vb code?
-
Jan 29th, 2003, 09:11 AM
#6
Registered User
System.Diagnostics.Process.Start has an overloaded version that takes filename and argument.
ex:
Code:
System.Diagnostics.Process.Start("arj.exe", "-va -y")
-
Jan 29th, 2003, 01:04 PM
#7
Sleep mode
Originally posted by Lunatic3
Thanks Pirate.
Shell synstax is :
Public Function Shell( _
ByVal Pathname As String, _
Optional ByVal Style As AppWinStyle = AppWinStyle.MinimizedFocus, _
Optional ByVal Wait As Boolean = False, _
Optional ByVal Timeout As Integer = -1 _
) As Integer
Is there an easy way to define optional arguments of Shell- Style,Wait and Timeout- for Process.Start ?
Isn't this func from VB6 ?I mean API ?
-
Jan 29th, 2003, 07:22 PM
#8
Thread Starter
Lively Member
Originally posted by Athley
System.Diagnostics.Process.Start has an overloaded version that takes filename and argument.
ex:
Code:
System.Diagnostics.Process.Start("arj.exe", "-va -y")
I've used this code, but only command prompt opened and file was not copy into the a:
System.Diagnostics.Process.Start("c:arj.exe", " a a:test c:test.mdb -va -y")
-
Jan 30th, 2003, 02:29 AM
#9
Registered User
Originally posted by chinhow
I've used this code, but only command prompt opened and file was not copy into the a:
System.Diagnostics.Process.Start("c:arj.exe", " a a:test c:test.mdb -va -y")
The argument part of the start method should not include the preceding space. Try...
Code:
System.Diagnostics.Process.Start("c:\arj.exe", "a a:test c:\test.mdb -va -y")
As it is an argument it presumes it should be a space and adds one itself.
Last edited by Athley; Jan 30th, 2003 at 01:04 PM.
-
Jan 30th, 2003, 12:58 PM
#10
Member
format:
Shell("C:\program.exe")
Easy as 123
Smartbar XP is WAY better then Dashboard. http://www.smartbarxp.com
-
Feb 1st, 2003, 03:02 AM
#11
Thread Starter
Lively Member
Originally posted by Athley
The argument part of the start method should not include the preceding space. Try...
Code:
System.Diagnostics.Process.Start("c:\arj.exe", "a a:test c:\test.mdb -va -y")
As it is an argument it presumes it should be a space and adds one itself.
yes, i tried System.Dianostics.Process.Start("C:\arj.exe", "a a:test C:\test.mdb -va -y") BUT it won't treat the latter as the arguments. In other words, the exe is doing nothing but just open the command prompt and close it without execute the file copy.....
-
Feb 1st, 2003, 06:43 AM
#12
Frenzied Member
Try this 
VB Code:
Dim p As New Process()
p.StartInfo.FileName = "arj.exe"
p.StartInfo.Arguments = "a a:test c:\test.mdb -va -y"
p.Start()
Dont gain the world and lose your soul
-
Feb 5th, 2003, 07:28 PM
#13
Thread Starter
Lively Member
Originally posted by DevGrp
Try this 
VB Code:
Dim p As New Process()
p.StartInfo.FileName = "arj.exe"
p.StartInfo.Arguments = "a a:test c:\test.mdb -va -y"
p.Start()
Thanks, It's worked!!!!
But why the command prompt didn't display the progress ?
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
|