473,503 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling any Exe or Bat file by VB6.0

1 New Member
Hello Friends!

Can you help me for calling a exe or bat file by the code of vb6.0?

Thanks.
Feb 23 '08 #1
7 19100
VACEPROGRAMER
168 New Member
I think Run("C:\ . .. . ") or Start("C:\........") will help. In this moment I work on vb 2003 and vb 2005 so I need to see the code in vb6.0. I will send you the code, don't wary

VxE
Feb 23 '08 #2
VACEPROGRAMER
168 New Member
Or maybe Open("C:\ . .. . .). never mynd , i need to see it . . .

VxE
Feb 23 '08 #3
gobblegob
133 New Member
Try this

Expand|Select|Wrap|Line Numbers
  1.    Dim BatFile As String
  2.    BatFile = "c:\first.bat"  
  3.    ExecuteDOSCommand = Shell("""" & BatFile & """") > 0
Gobble.
Feb 24 '08 #4
lotus18
866 Contributor
Try this:

Expand|Select|Wrap|Line Numbers
  1. Shell App.Path & "\sample.exe", vbMaximizedFocus
Feb 24 '08 #5
lotus18
866 Contributor
Or :

Expand|Select|Wrap|Line Numbers
  1. Private 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
  2.  
  3. Call ShellExecute(Me.hwnd, vbNullString, App.Path & "\Sample.exe", vbNullString, vbNullString, 2)
Feb 24 '08 #6
VACEPROGRAMER
168 New Member
Dim Q as String
Dim Path as String
DIm FullPath as String

Q =""""
Path = "C:\vace.bat"
FullPath = Q & Path & Q

Shell(FullPath)

VxE
Feb 26 '08 #7
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Button2_Click(ByVal sender As Object, _
  2.         ByVal e As System.EventArgs) Handles Button2.Click
  3.         Dim psi As New _
  4.             System.Diagnostics.ProcessStartInfo("C:\listfiles.bat")
  5.         psi.RedirectStandardOutput = True
  6.         psi.WindowStyle = ProcessWindowStyle.Hidden
  7.         psi.UseShellExecute = False
  8.         Dim listFiles As System.Diagnostics.Process
  9.         listFiles = System.Diagnostics.Process.Start(psi)
  10.         Dim myOutput As System.IO.StreamReader _
  11.             = listFiles.StandardOutput
  12.         listFiles.WaitForExit(2000)
  13.  
  14.         If listFiles.HasExited Then
  15.             Dim output As String = myOutput.ReadToEnd
  16.             Debug.WriteLine(output)
  17.         End If
  18.     End Sub
Oct 18 '10 #8

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

Similar topics

2
4445
by: Marc Shapiro | last post by:
I am relatively new to python (I have used it on and off for a few small projects over the last few years) so I imagine that what I am trying to do has already been done, but practical experience,...
2
1609
by: Christiaan Nijdam | last post by:
Hi, Is there a way to determine the filepath of an included file?: First file contains: <!--#include file="WysiwygEd/Inc_WysiwygEd.asp" --> <%SomeSub%> Second file Inc_WysiwygEd.asp...
13
2108
by: Leo | last post by:
Hi I had asekd previously a question qith regards to running a DLL file from ASP. It was not running for me. Bo error returned, nothing, Just an empty string (when it should have not been...
9
3014
by: Casanova | last post by:
Hello! How can I execute other exe files from within a executable file in GCC. In TurboC 3, the spawn command executes a file and returns command to the calling file. whereas in GCC, the exec...
0
1319
by: Shannon Cayze | last post by:
Hello all, I'm having trouble using a CrystalReportViewer when I set the ReportSource property to a file on another server. When I do this, I get a "Load report failed" exception. I've learned...
6
7769
by: abcd | last post by:
How can I call one ASP page from another Page1.asp returns me some strings in the form of response.write Page2.asp will call page1.asp and use that long string returned from page1.asp.... ...
1
1778
by: PI | last post by:
Hi guys, I need some urgent help here please: I am using an include_once() command to include a file that sits a level above the file view.php. when the code is run, I have an error as follows: ...
1
2344
by: Dachshund Digital | last post by:
If Explorer can display a file path longer than 260 odd characters, why is it that System.IO.File.Open Method can not? Calling GetFiles from my.computer.fileystem can return paths longer but...
8
1802
by: eros | last post by:
//page1.php <?php include('pagebase.php'); ?> //pagebase.php <?php echo __CALLING_FILE__; // outputs the previous php file. 'page1.php' ?>
0
1164
by: =?Utf-8?B?VmlqYXkgR2FuZXNo?= | last post by:
We are using a logo by calling Image.FromFile(). Based on that we are opening a report (using a 3rd party Report generation tool) and without closing the report, We are trying to change the logo...
0
7199
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
7074
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
7322
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
7451
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
5572
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,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.