Execute Commands Like In Command Prompt?
Sep 20, 2009I 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 RepliesI 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 Repliesi'm tring to execute some commands in cmd prompt in vs 2008. (with out using BATCH FILE)
[Code]...
The question is self-explanatory. It would be great if the code was one line long (something to do with "Process.Start("...")"?). I researched the web but only found old examples and such ones that do not work (at least for me). I want to use this in my class library, to run Git commands
View 1 RepliesIn my application I have only one button . That button will open CMD then it will send a command into cmd , now after that command it requires an "enter key" to continue the process .I tried the shell command in order to access the command but then I couldn't press enter in cmd using my application
View 4 RepliesI am trying to send commands to Command prompt.The following code should open the text file I specified.However it opens several instances of the cmd window and also several copies of the text file. Sometimes the text file is not opened and if the file path is long, part of the file path gets inserted into my text file.[code]
View 1 RepliesI am using Visual Studio 2010, VB to compile my program. My program include having to open a command prompt and writing a command to it.and display the output/errors in a textbox. But i can't seems to make it display it in a textbox and it opens ALOT of command prompts windows.
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Try
Dim P As New Process[code].....
I am working on a vb.net project and i have a "start" and "Pause" Buttons on the FormPost.exe
I am trying to schedule a batch process to run every day in the morning at 4:00 AM.
How can i run a command prompt to execuite FormPost.exe and them click on "start" button, all via command prompt?
I want to execute a command on DOS prompt with getting the file name at run time. I tried the following command, it didnt work.[code]...
View 1 RepliesI need to execute commandpromt process async and get the output of the execution. i currently have this code
Public Function ExecuteCommandSync(ByVal command As Object) As String
Dim result As String = Nothing
Try
[Code]....
What I have done so far is place the compiler inside the bin of my project folder, inside the Debug folder. I managed to call the cmd shell but the problem is whenever I pass commands to that cmd shell, it doesn't work. What happens is it opens a cmd shell and when I pass commands on it, it opens many other shells.[code]...
View 1 RepliesOkay, heres the deal...I need to open up a cmd prompt, then run a file called adb.exe which opens a shell to communicate with my android cell phone...
My Form1
Code:
Label1.Text = "adb.exe shell"
[code].....
I tried to make a media player by following this guide: [URL]
The problem is that I want to execute the mediaplayer from a batch script and auto-play a .avi like so: C:MediaPlayer.exe filename.avi
But this will only start an emty mediaplayer.
How do I make the MediaPlayer accept the .avi filename?
In the Windows Shell, there is a command that looks like this: copy /b fileA.zip + fileB.jpg fileC.jpg..Is there any equivalent function in VB.NET? I already know this works: [code] But I would much rather have a built-in function to work with. Here is what I am trying to do: url...Also, this doesn't just work for pictures. It works for any binary file. Is there any way in VB.NET to tell if a file is binary or text?
View 3 RepliesIs there a way to hide the characters of a "set /p password=Enter Password:" command? Or any new strand not using the SET command i could use instead?
View 2 Repliescatch 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].....
I need to execute AS/400 System Commands thru VB. What would be the way to perform this?
View 4 RepliesI 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 RepliesI 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 RepliesI 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 RepliesI'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.
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.
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;
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?
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 RepliesI 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]....
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 RepliesJust 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 RepliesI need to sort my code to work for Visual Basic 2008 Express Version, I am trying to open the Command Prompt through Visual Basic and make Visual Basic run through the Command Prompt. By this i mean i need Visual Basic to Send Messages from a text box on my design to the command prompt, e.g to make my program go through the command prompt to do the basic hide files in a picture.
[Code]...
I am not a developer but I like tweaking with system, I am recently trying to create an app that can reset admin password, but the problem is that I am not able to run the following command from standard account.
net user user_name * I know it is because of security reason but there must be some way so that software developer can tweak it, can someone guide me..[URl]..
Before posting this question I have carried out a few searches on this forum but I am afraid I am struggling because I am very new to Visual Basic and although I do have some programming background, yesterday was day 1 and I took a web tutorial and watched a few video tutorials. (Long way to go!).
OK to the question and I know I should really not ask 2 but It's better to get them both in one post I think.
I want to build a small utility to run a form in full screen to basically hide an old application running in the background.
My old application is a database (Non VB code) which works very well but while it batch exports a lot of data the software displays some pretty ugly windows, I want to call my VB utility from a command prompt with 1 or more switches to display some meaningful text about where it is in the routine.
I also want to be able to send a switch at the end to close it completly.
Q1 - What is the best way to manage command prompt switches ?
Q2 - How do I make it close itself ?