473,327 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Open + Close .bat / .cmd

So guys, I was just wondering if there was a code I could get from anyone that would Open + Close a .bat or .cmd file? Not ALL .bat / .cmd files that are open, but just ONE (runserver.bat / runserver.cmd)

Please post both codes seperately.

Thanks,
Sierra
Oct 9 '10 #1
1 1887
!NoItAll
297 100+
For a running application (including bat/cmd files)look at using:
Expand|Select|Wrap|Line Numbers
  1. Dim Instance as Process = Nothing
  2. Dim MyProcesses() as Process = Process.GetProcessesByName(YourProcess)
  3.  
  4. For Each Instance in MyProcesses
  5.  Instance.CloseMainWindow()
  6. Next
  7.  
To start a process then you can look at using:
Expand|Select|Wrap|Line Numbers
  1. System.Diagnostics.Process.Start(YourCMDfile.cmd)
Oct 13 '10 #2

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

Similar topics

1
by: Robin Tucker | last post by:
Just a quick question about connection management. My application will never need more than 1 or 2 connections about at any given time. Also, I do not expect many users to be connected at any...
4
by: Macca | last post by:
Hi, I have an windows forms application that accesses a SQL database I have a few questions as to connecting to the database. This application will run 24 hours a day. It is a monitoring...
1
by: Ian | last post by:
I have just begun to to learn how to write macros in VC++. For learning purposes, I would like to implement a macro that accesses all files in a 'test' project and makes a series of changes to...
2
by: Michael | last post by:
Hello, In my past ASP pages, at the top I used an include file to open an ado connection for the entire page, then at the bottom, I would have another include file to close the connection. ...
1
by: Sorin Schwimmer | last post by:
Hi, I tried for the first time a Tix Tree, so, if my question is naive, I apologize upfront. The following code: <code> from Tix import * r=Tk()
3
by: pratham | last post by:
Hi and regards What is best method to have an connection to sql, iam using sqlserver 1. have an sqlconnection open when the application start event in global.asax so that i dont have to open...
2
by: jy43 | last post by:
I am writing a method for a web service that returns an empty element.(not null) The SOAP generate the response XML message using shorthand format for the empty return object. < soap:Body > ...
4
by: Martin Arvidsson, Visual Systems AB | last post by:
Hi! I am currently developing my first webapplication using .net (2.x) In a couple examples seen in the helpfile that came with VS2008 i see that they are opening a connection to the sql...
2
by: Nitinkcv | last post by:
Hi all, I have a div which can be closed and opened on click of a section. Now what i would like to do is that on open and close the div should have a sliding effect. Normally what we would do...
0
by: foltac | last post by:
We run a database replication process that ultimately puts a new copy of an Access DB in a new folder (on the server harddisk) every night. The folder is programmatically named and includes the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.