Execute Commands In CMD From Progra 2010?

Feb 26, 2012

I am new to VB and am trying to write a program that will open cmd and execute commands when a button is clicked.[code]...

View 14 Replies


ADVERTISEMENT

Execute Two Commands At Once?

Dec 31, 2009

catch statements - it works well just checking my disk drive for a file, if an error is thrown then I open the disk tray and ask them to put the disk in, click OK on the message box and it performs another check for the file, if this fails the button that starts all this is disabled on my main form (the code is shown below).

Okay, so my problem is I'd like to have the message box pop up and the have the drive open up (using an API which I have) either at the same time or in the order of: message box then drive open. I can see two ways to do this: Have the commands happen at the same time (Can you even do this?) OR Have the message box appear and then open the disk drive (but how I could achieve this I don't know as the message box waits for the user to click OK... I originally though of starting a timer just before and getting it to open the disk drive tray in the tick event,

Code:

Public Class Form1
'open cd-rom tray API
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal _

[Code].....

View 5 Replies

Execute AS / 400 System Commands Through VB

Jan 20, 2009

I need to execute AS/400 System Commands thru VB. What would be the way to perform this?

View 4 Replies

Execute Commands Inside Another Program?

Jun 29, 2009

I want to make a program with a button and a textbox. When i click the button the program (don't know how) writes the text from the textbox in a process called test.exe. Test.exe is a cmd like window, there is only one place to write on it. How can i make it happen?

View 4 Replies

Execute Commands Like In Command Prompt?

Sep 20, 2009

I know of the Shell method to run files, but how can I execute normal command prompt commands like nslookup, and capture the output as a string?

View 1 Replies

Execute Commands Stored In String?

Jun 6, 2011

I trying to figure out how to execute commands stored in string, let's say i have string called "command" and a textbox, so i want vb to run command that i typed in textbox, e.g. i type in textbox "label1.text = "bla bla"", and then type like "msgbox.show". Is that even possible?

View 12 Replies

Execute Remote Powershell Commands Using C#?

Feb 25, 2012

I'm evaluating the best approach to implement the following periodic task:

Get some users from SQL Server (2008) and then for each user enable licences in the Cloud (Office 365) using PowerShell.

My first thought was a console-based app in C# or VB.net but now that I realize that running a PS Script remotely using C# can be quite a challenge I'm starting to think in alternatives like perform all the stuff using PowerShell, I guess this is a better approach but I'd like to hear your thoughts on this.

View 2 Replies

Execute Shell-commands With Parameters?

Mar 2, 2010

I cant understand why this works (Start a service "test" on a remote computer):

Dim rCommand As String
rCommand = "c:pstoolspsservice \computer -u admin -p blabla start test"
Shell("cmd.exe /c" & rCommand)

[Code]....

The above code that doesnt work starts a virtual machine on VmWare Server. I have the exact same line in a .bat file and if i call the batfile from VB it starts the batfile and execute the commmand. I cant understand why this doesnt work without the batfil when i have no problem executing the PsTools command from VB-code.

View 2 Replies

Execute Some Commands In Cmd Prompt In Vs 2008?

Feb 2, 2010

i'm tring to execute some commands in cmd prompt in vs 2008. (with out using BATCH FILE)

[Code]...

View 4 Replies

How To Execute DB2 Commands Programatically For Backup

Sep 1, 2009

How to execute the DB2 commands programatically for Backup..Here are the commands that need to be executed for DB2 Backup.I am using IBM.Data.DB2 namespace, And as soon as we connect to Dbase in step 2 it crashes to QUIESCE.

1.CONNECT TO <DataBase Name>
2.QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;The Exception Message I am getting [code]
3.CONNECT RESET;
4.BACKUP DATABASE <DataBase Name> TO "C:\" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 COMPRESS WITHOUT PROMPTING;
5.CONNECT TO <DataBase Name>;
6.UNQUIESCE DATABASE;
7.CONNECT RESET;

View 1 Replies

Multiple AT(ATtention) Commands Execute Using C# Or .net?

Oct 9, 2011

I need a coding to execute multiple at commands simultaneously. when first command execute and get the response from the port and then the second command will be executed. how to write the coding. it is possible. i am using siemens gsm modem.

[Code]...

when i execute this coding i can't get the correct result because the port response will take some times.how can i identify the time delay. when i use thread.sleep(300) means this is also not correct for my solution. Because the port response will take more than 300 milliseconds?

View 1 Replies

Start A Run Window And Execute Commands In It?

Nov 18, 2009

I need to start a "Run" window(The one that opens when you press Windows+R or Start->Run) and run few commands in it from a VB.NET program.

View 5 Replies

Forms :: Execute Raw Commands Typed In A Textbox?

Sep 11, 2010

I am working on a "de-bugging" back-end sorta thingy for my program, and I have a "dll" that executes most of the work for the program. For the ease of tech-support, I plan on trying to impliment a hidden back-door into the engine that is password protected and activated by a key-press. What I want to do is:when the enter key is pressed, have the dll run the sub that is listed in the enter key, for example:

In the dll:
Public Sub msg(ByVal text as string)
MsgBox(text)

[code]....

View 2 Replies

Execute 3 Commands (SQL Statements) To 3 Different Oracle Tables At One Shot?

Apr 24, 2012

I'm implementing an application using vb.net 2005 with oracle 10g and I came across a functionality that should Select/Insert/Update/Delete data from three different tables in oracle.So I`m wondering if there is a way to prepare all the 3 commands (SQL Statements) separately and then execute them in one shot to the oracle, so in this way I can guarantee that all of them are successfully executed or all are failed to execute, and also I could gain more performance which is critical in my case.Thus I`m looking for a syntax in vb.net that helps me execute more than one OracleCommand in one shot to the oracle.

View 1 Replies

Execute Commands In Cmd.exe Just A Simple Net Stop [service] And Get A Error 5?

Nov 22, 2010

Just trying to execute commands in cmd.exe just a simple Net Stop [service] and get a error 5. I want it to run cmd in administrator mode. One way I have seen that you can by holding down ctrl & shift while clicking cmd.exe?

View 26 Replies

Open A File With Its Respective Application In Progra

Mar 2, 2010

I need to open any kind of file with its respective application from vb.net code, just like when we double click a file in windows it gets opened with its appl,like a WORD file with MSWORD, .xls file with MSEXCEL etc

View 1 Replies

Unable To Run Unix Commands To Execute Processes On A Unix Server?

Jul 6, 2011

I was recently assigned to do some research on how to approach a project. Right now we have an old program written in tcl. From this tcl program ( running on VMS client computer), we are able to run unix commands to execute processes on a unix server. This is done via tcpip. Now, we are thinking of making upgrades to this system . We are wondering if this kind of thing was possible with Visual Basic. Are we able to run a VB program on windows computer to run UNIX commands on a server? If so, what issues might be brought up. If anyone has even the briefest guideline or tip on this,

View 3 Replies

VS 2010 - Sending Commands To Process?

Jan 25, 2010

Dim movie As String = TextBox1.Text
Dim subtitle As String = TextBox2.Text
Dim box As New Process
box.StartInfo.FileName = "MP4Box.exe"

[code].....

When i click a button this code is executed. But it wont execute the command "MP4Box.exe -ttxt " + """" + subtitle + """" Why?

View 7 Replies

VS 2010 : Running Dos Console Commands?

Dec 8, 2011

I'm having trouble opening and running DOS commands through VB Express.I'm trying to have VB open a command console and enter path to a batch file. So far I have not been able to get VB to open a console and enter any text.[URL} Here is the code I am using right now (without success)

Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal longPath As String, ByVal shortPath As String, ByVal shortBufferSize As Int32) As Int32
Private Sub des_date_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles des_date.Click

[code]....

View 11 Replies

VS 2010 Datasets Or Handwriting SQL Commands?

Aug 19, 2011

Im just starting to develop an application using a SQL Database as the main datasource. Now im wondering is it better to use the in-built dataset adapters or write the querys yourself?

If its better to use the pre-generated scripts by using the Datasource UI, How can i use these datasets on a JOIN query?

Example Join
SELECT column_name(s)
FROM table_name1
JOIN table_name2
ON table_name1.column_name=table_name2.column_name

View 3 Replies

VS 2010 - Creating Delay In Between Two Commands Of Script

Jun 16, 2011

I am currently in the process of writing a demonstrative program that will generate a string of 9 random numbers in a textbox. Now my basic knowledge of VB 2010 allows me to do this but my goal is to delay the generation of this number sequence until the my progress bar has progressed to the end. How can I insert a delay after my button activates my progress bar/timer without stopping all function and usability of the program all together. The basic wait function seems to lock everything up for the allotted time and then the number instantly generates and the progress bar begins.

View 8 Replies

VS 2010 Data Sources Versus SQL Commands

Apr 19, 2011

I prefer having total control for data access, populating recordsets (now datasets) precisely via a connection string and SQL select (or stored procedure call), etc.Now I wonder whether I really should be using the Data Sources option which just popped up on my radar? From the little I've seen so far, it seems to bind an entire table to a control, whereas most of the time I only need a small number of records from large tables.Before I spend a lot of time investigating, I hope a quick word from you might help me feel happier continuing as I am, or whether I need a kick up the backside towards a Better Way.

View 12 Replies

VS 2010 Sending 'text' Commands To A Console App

Feb 15, 2012

I need to build an forms app that 'posts' or 'sends' text commands to an external console process, called Minecraft Server It is a java-based process, filename 'minecraft_server.jar'. Run by my computer via 'java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui'. The Process ID I assume would change each time it's run. This process can be downloaded here: [URL]

I am guessing that I need to:

1) find the Process ID for it, based on its process details, such as Command Line

2) figure out a way to 'post' these commands, commands such as "stop" into the console window

I cannot have this process launched by my VB project.

View 5 Replies

VS 2010 - Sequence Of Commands To RS232 - How To Sure Command Is Received

Dec 20, 2011

I write in VB2010, the software should work with the external hardware via RS232, the thing is when I send a command to the external hardware I have to wait for a reply from the device that command was received, just after I got the answer I want to continue send another command, I have a long sequence of commands i'm supposed to send, but I need to know for sure that the commands were received before I go on to the next command. I did the following code, but I think the code is not effective, because sometimes I do not get an answer and then the whole sequence commands destroyed. Maybe you can help me optimize the code? [Code]

View 1 Replies

VS 2010 : Send RCon Commands To Game Server?

Dec 20, 2010

im trying to send RCon commands to a Call of duty: Black Ops game server.I read a thread from a few years back about sending RCon commands to a CoD 4 server, and all look promising until the application kept crashing when I pressed connect.

[code]....

all I want is to be able to send a few commands to the server through an application.

View 18 Replies

VS 2010 GSM Modem / AT Commands - Test If The Message Was Successfully Sent?

Aug 19, 2010

I have an application, for sending SMS to mobile phones, using a GSM modem and AT commands. It works perfectly, except in one point. If the modem have some problem, for example doesn't have network, or even doesn't have a SIM card, I dont know if the message was sent or not. How can I test if the message was sucefully sent?

View 15 Replies

Get SQL Commands (adding, Updating, Deleting) To Work With A VB 2010 Database?

Feb 12, 2012

My project involves making a table database that displays student number, surname, first name, homeroom, and grade avg. Through SQL commands, there must be functions to add, update, delete, search by field, and save records to the database.I have already set the database up just fine and displayed it in a DataGridView. Through the DataGridView, I was able to go to the "Add Query" area, and I successfully made the queries necessary for searching by field. However, when I try to do anything other than a search using the query builder (ie start my SQL command with INSERT INTO or DELETE FROM), I ultimately get the message "Failed to get schema for this query"For example, this SQL code (to add an entry to the database) worked when I was in the Query Builder (and the entry that it made is still in the database), but when I finally tried to confirm it, I got the "Failed to get schema for this query" message.Being unable to add entries to the database this way, I tried to do it with textboxes on a form. Each textbox will have one of the fields, and at the click of a button, they would be put into the table. My code is below. I do not know what is wrong withit. When I run it, my fields do not appear on the DataGridView immediately, but I must run the program again to see it. The time after, the entry is gone. So I am not sure how exactly such entries are to be saved.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try

[code].....

View 1 Replies

VS 2010 How To Execute If Not

Jan 20, 2011

How do i write in If not on vb2010??

View 1 Replies

Execute A SQL 2000 DTS Package From VS 2010?

Mar 30, 2011

What is the appropriate way to do this?

View 2 Replies

VS 2010 - Execute App On Remote Machine Using WMI

Jan 1, 2011

I am trying to execute exe file on remote machine using wmi. Its basically work on 50%, but problem is interactive process it execute the app but i can't see any window or form but I can see app is running in the task manager. Does not need to be vwi, might different method, but I dont want to use psexec tool.

My function:
Public Function StartEXEonRemote(ByVal machine As String, ByVal file As String) As String
Dim wmi As ManagementClass
Dim wmi_in, wmi_out As ManagementBaseObject
Dim retValue As Integer
[Code] .....

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved