473,473 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Visual Basic - Button to run command or vb script?

Hi,

I need to create a GUI that has a form, on the form it asks for
username. I therefore decided to use Visual Basic (not much
experience_ On the form will be a button, how do I get this button to
then launch a vbscript, oe even a batch file when it is clicked?

Thanks.
Dec 5 '07 #1
3 8061
On Dec 5, 3:01 pm, mrmwal...@yahoo.co.uk wrote:
Hi,

I need to create a GUI that has a form, on the form it asks for
username. I therefore decided to use Visual Basic (not much
experience_ On the form will be a button, how do I get this button to
then launch a vbscript, oe even a batch file when it is clicked?

Thanks.
Take a look at System.Diagnostics.Process. If you have any further
questions, let us know.

--
Tom Shelton
Dec 5 '07 #2

<mr*******@yahoo.co.ukwrote in message
news:24**********************************@w40g2000 hsb.googlegroups.com...
Hi,

I need to create a GUI that has a form, on the form it asks for
username. I therefore decided to use Visual Basic (not much
experience_ On the form will be a button, how do I get this button to
then launch a vbscript, oe even a batch file when it is clicked?

Thanks.
What you are looking for is the Process class.

There are several versions of Process.Start. If the filename extension is
known to windows you can use the simple one by just using the name of the
file you want to start (acts like a double click in explorer).

If you have parameters there is a version where you give the filename
followed by a string with the parameters.

It would be something like (not a workstation with VS).

dim p as Process
p=Process.Start("C:\my folder\my batchfile.bat")
p.WaitForExit()

the last statement will wait until the process finishes if this is important
to what you are doing.

Hope this helps
LLoyd Sheen

Dec 5 '07 #3
Lloyd - Tom,

That's excellent - does exactly what I wanted it to do - thanks very
much for your help, very much appreciated!

Dec 6 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tom Rahav | last post by:
Hello all! I develop application in Visual Basic .NET and ORACLE database. My question is how do I "send" script file to the database using visual basic .net. Other words, is there any way to...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
0
by: Faez | last post by:
i am using Visual Studio 2005 with Visual Basic language. i have a command button, labelled 'SEARCH' and i want to add the following code to the button; so that when people click on the search...
0
by: AJIT PITALE | last post by:
Hi, I am using Visual Basic 6 as front end and Visual FoxPro as a Database. I am trying to pass a parameter from VB to Visual FoxPro's Stored Procedure. I am getting an error showing "Data...
5
hussaini
by: hussaini | last post by:
please tell me any 1 printing code in datagrid in visual basic 6 in detail ----- Hello seniors members hope u will tell me ..... i have created a form in visual basic 6 so in the form there is a...
0
AHMEDYO
by: AHMEDYO | last post by:
Hi Every one... With this visual Basic 6.0 Code you can handle more event that visual basic Support as Mouse wheel and hover or you can control event before VB IDE Default Windows proc as...
2
by: mixalis21 | last post by:
hi, i really need to know in this month a way to take data from a vb form and put then in particular places in a word/excel document which i have already created. for example, i have a text...
16
by: AirborneBob | last post by:
I just installed MS Office Enterprise on my system today and jumped right in to MS Access. Because I am familiar with Access I had very few problems navigating around. Here is the big question. ...
7
by: rmurgia | last post by:
When a variable is created using Javascript, should it then be able to be read immediately using embedded VB code or does the submit command have to be entered or are the variables between...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.