|
-
Apr 29th, 2002, 12:43 AM
#1
Thread Starter
Member
Shell Execute Help !!
Dear
How can i call batch file from VB when program is run ?
Best Regards
Long
-
Apr 29th, 2002, 12:45 AM
#2
PowerPoster
In the Form's Load Event
Shell("location of a batch file")
That what u want??
-
Apr 29th, 2002, 12:47 AM
#3
Thread Starter
Member
I've try but sometimes failed !!!
Someone can help me ?
Best Regards
Long
-
Apr 29th, 2002, 12:49 AM
#4
Lively Member
syntax is
shell "program name", state.
where state is vbhidden, vb maximised etc.
Money is a great thing, but it can't purchase satisfaction....
Respect money, but don't allow it to control you...
-
Apr 29th, 2002, 12:53 AM
#5
try this
VB Code:
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
private sub command1_click()
Call ShellExecute(hwnd, "Open", pathtobatchfile, "", App.Path, 1)
end sub
-
Apr 29th, 2002, 01:12 AM
#6
Thread Starter
Member
I've try but sometimes failed !!!
Someone can help me ?
Best Regards
Long
-
Apr 29th, 2002, 01:16 AM
#7
PowerPoster
Maybe you should post your app/ or your code so that we can have a look.
-
Apr 29th, 2002, 01:26 AM
#8
Thread Starter
Member
This is my sample program
Private sub Command1_Click()
Shell ( "C:\Connect.Bat")
form2.show
end sub
Private Sub Form_Unload()
shell ("C:\Disconnect.Bat")
end sub
in Do.Bat i put some coding to connect from one server with another server at difference place.
If i run my batch file from dos it's work.
Best Regards
Long
-
Apr 29th, 2002, 01:37 AM
#9
PowerPoster
Well I don't know much about Batch Files but, maybe theres something wrong with them instead??
-
Apr 29th, 2002, 01:42 AM
#10
Thread Starter
Member
my coding in batch file such :
net use \\testing\ipc$ /user:dm_tester\name pass
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
|