Running A Command In A Console Application In Visual Basic?
Aug 1, 2011
I am new to Visual Basic and i started to write a console application. I it working fine by now, but I tried to execute a command like shutdown -s I tried that by writing
console.writeline("shutdown -s")
but all it dows it displays the text and does not shutdown the computer. How do I code that correctly???
View 3 Replies
ADVERTISEMENT
Dec 17, 2010
I am new to Visual Basic and i started to write a console application. I it working fine by now, but I tried to execute a command like shutdown -s
I tried that by writing console.writeline("shutdown -s")
but all it dows it displays the text and does not shutdown the computer. How do I code that correctly???
View 4 Replies
Apr 25, 2011
I was wondering if someone could tell me how to print text from a console application to the default printer.
View 1 Replies
Feb 15, 2010
Any advantages of protected modifiers in console application in Visual Basic .NET
View 2 Replies
Jun 24, 2009
i allready know i cant use sendkeys.send, whats the other code to do this?
View 2 Replies
Apr 8, 2012
I have a procedure at the end of my console application that ask the user to either hit enter to end the program, or type s to perform another search. The issue I'm having is no matter what the user types in the program end. What I would like to happen is if the user types s, then the program starts over and lets the user perform another search. The program is procedural and I need to find a way to start back off at the top of the program which ask the user to type a name to search.
[Code]....
View 1 Replies
Jan 22, 2010
I am trying to make a console program in Visual Basic on Visual Studio 2008. I want to ask the user of the program if he wants the premium version or the standard version. If he chooses the premium version, then I want it to say premium in his "receipt" later on and if he chooses standard, then standard in the receipt.
[code]...
View 1 Replies
Jan 12, 2012
I've managed to find from other questions some data that allows me to achieve the next code:
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll")> _
[Code]....
My problem is that I can't manage to find the DOS console window.
The question in C# Embedding a DOS console in a windows form
View 1 Replies
Jul 14, 2011
How would i run a batch file and instead of opening a DoS window and showing the text in a Textbox or Richtextbox... And if i can do that, how would i make another textbox that issues commands to said batch file
View 11 Replies
Feb 26, 2009
Im still working on my scheduling program and Im thinking of how to get it where it dont add my agent until they actually leave for lunch and not just t the time they are "supposed" to. So sine my program sends emails Ive been thinking of making it where the agent replies with #lunch sh250080 and then when my program receives it it adds them to the lunch list.
View 3 Replies
Jan 19, 2009
I have already posted this assignment . The assignment is to create a VB.NET program that calculates the monthy mortgage payment for a $200,000 mortgage with an interest rate of 5.75% for 30 yrs. The program compiles and the interface window comes up but when you click the payment button nothing happens. fix this program because my other 4 assignments are based on this progam. The Visual Studio project file is attached.
Public Class Form1
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
[code]...
View 6 Replies
Apr 5, 2012
how to SQL Command and fill Result in ComboBox? in visual basic 2010 my DataBase
Dim SqlCon As New SqlClient.SqlConnection("Data Source=DIG-PCDIGSER;Initial Catalog=;Integrated Security=True") Dim ConDatBas As New SqlClient.SqlConnection("Data Source=DIG-PCDIGSER;Initial Catalog=DigSMSystem;Integrated Security=True")
View 7 Replies
Jun 28, 2010
i am working on this code that is going to query a database for an entry and return the value of the tracking number and the time to print on a label if the tracking number exist in the databse. it does not right now it only seems to reprint the number that is enetered in a text box and it does not grab the date. here is the code.
Dim TrNum As String = Me.DupTNText.Text
Dim TrDate As <=something if it is even needed
Dim connectionString As String = "Data Source=XXXXX;Initial Catalog=YYYYY;Integrated Security=True;Pooling=False;Encrypt=False"
Dim cmdText As String = "SELECT TrackingNumber, Date" & _
[code].....
View 3 Replies
Aug 24, 2008
In VB, i see file format in wav, but how we can run other formats through vb code my.computer.audio take wav format is there any other posibility
View 5 Replies
Apr 1, 2011
I followed Ziannb article on involking powershell from visual basic. It works great but it doesnt allow me to run scripts with [URL]
- how can i run powershell scripts with arguments from VB
- how can i run one powershell command line at a time from VB. When i use below two command, it pipes the first command to the second one..instead of running them individually :
MyPipeline.Commands.Add("get-childitem")
MyPipeline.Commands.Add("get-date")
View 2 Replies
Jan 4, 2011
I hope someone can help with a very frustrating problem I'm trying to solve in one of our Windows Forms apps written in Visual Basic 2005 and running on Windows XP SP3.
The app is essentially quite simple in concept but there is lots of code and data, however, the problem does show itself consistently. The app does the following:
1) Startup
2) Choose Access database to load data from
3) Load the data into memory as a series of collections of objects
4) Do lots of number crunching
5) Fails when entering a particular sub for the first time with an Access Violation Exception
The most difficult aspect of this problem is it only shows itself when compiled in Release mode. It doesn't show itself when running in Debug mode either within Visual Studio or running outside Visual Studio. I assume this is due to the extra 'padding' in a debug exe which is masking the effect of bad code causing the error. The problem is made worse in that the 'standard' build target machine where the problem shows itself only has a copy of Visual Basic 2005 Express so as a result I have been debugging the app at runtime using WinDbg which is tricky but sort of fun (for a nerd!).
I have read / researched extensively on the internet for solutions and as a result have tried the following but all without success:
a) checked for any badly declared DLLs (p/invoke) but the app doesn't use a single one.
b) checked for any COM references / interop. There were two references which were rarely used so I removed them and commented out the code that referenced them but the exception was still raised.
c) I've tried adding my own trace code in the problem area and the line prior to calling the Sub runs but the first line of the Sub never executes due to the Access Violation exception being raised.
d) I have used WinDbg to set breakpoints around the problem area at runtime which has confirmed 'c' above that the sub never executes.
e) I have used WinDbg to double check the addresses of the parameters passed into the Sub are correct as they seem to correctly point to the same address as the local / module level variable that was passed in.
f) I have checked all of the extensive data loading is not eg leaving DataReader objects open etc.
g) I have tried compiling the code in VS 2008 on a different machine targeting the 2.0 framework but the bug still showed itself.
View 18 Replies
Feb 26, 2010
I have a console application and I have figured out how to type in the command window with Console.WriteLine() but i need to run a command (ex. net user) then wait for a response and type another command, for some reason I cant figure out how to type the command and automatically press enter without closing the window. I tried Console.WriteLine("net user") but all it does is write "net user" in the command window so I used My.Computer.Keyboard.SendKeys("{ENTER}", True) after Console.Writeline and it just wrote "net user" then exited the window. Is there any way to run a command through a console application? if so how would i do this?
View 6 Replies
Feb 27, 2012
I have a program that auto fills a section on a webpage, how can i tell this command to ignore the textbox if its empty? If i dont the software crashes because the following command needs the box filled in order to proceed.
[Code]...
View 1 Replies
Mar 15, 2010
Just wondering if there is anyway to read each line of text that is output from a console application?
Basically I want to use PSEXEC through a vb.net GUI application and I would like to be able to read any error codes that may occur from the command line.
View 3 Replies
Jun 5, 2011
I was thinking I could make a console application that would have a FileSystemWatcher - watching for a .BAT file being created in a folder - and when it sees that file it does a PROCESS.START on it.
View 3 Replies
Jun 29, 2010
I have a console application that is ready to be used as a windows service, I have been looking around for a couple of hours and tried many of the tutorials out there but none of them worked with me.
The closest one was: [URL] but it didn't go into the process of doing it. I converted that code to VB.NET but then I don't know where to go from there. I have the Module1.vb which runs my console application all ready to be used.
show me a way to use my console application as a service, I tried using the InstallUtil feature but my app never showed under "services".
View 8 Replies
Sep 26, 2009
I have Visual Studio 2008 Professional and I'm trying to make it so I can click a button to send the application to the System Tray and then click the icon in the System Tray to make the application come back.
Can anyone provide me a method or sample code to do this?
View 8 Replies
Jan 21, 2010
I am in process of writing a setup program that will reside in a USB stick.After inserting the Stick the VB2008E program starts (dont know how) and guides the technician to do certain tasks. As a part of this She/He needs to run a Setup.exe that resides in the same USB stick.
1- How do I define the drive letter of this USB stick.
2- How do I run the x:Setup.exe program without exiting the VB2008? The install process should begin after click of a button.
3- Would Autorun work on USB drives to run the program automaticaly?
4- How do I compile to make a single EXE file at the end?
View 1 Replies
Apr 1, 2012
I was thinking I could make a console application that would have a FileSystemWatcher - watching for a .BAT file being created in a folder - and when it sees that file it does a PROCESS.START on it. But I'm seeing that a console app doesn't continue running.
Imports System.IO
Module awcWatcher
Sub Main()
Dim fsw As New FileSystemWatcher("D:ACS DesktopAWCeportingstaging")
fsw.NotifyFilter = NotifyFilters.FileName Or NotifyFilters.LastWrite
[Code] .....
How would I go about making this wait and then wait again and again and again?
View 9 Replies
Aug 19, 2010
When running a console application, the dos window disappears without asking for a "press any key to continue", why? What setting in 2010 is not set correctly?
View 3 Replies
Aug 25, 2011
I need a small app that randomly shuffles a set of preloaded numbers. The shuffling will be visible on the screen and goes on continuously (looping) until a key is pressed and as soon as that happens it will show the winning number.Am using visual basics 2008 to develop the application but my problem is when i start the app and hit a key it will loop through my numbers on the text file and it will also display the event but if i hit a key to stop it will not stop..I was workin on the app but my problem is how to stop the loop and resume on the with a keypress. below is the app codes.
Dim Running As Boolean = False
Sub ReadAccounts()
Dim arr As New ArrayList
arr.Add("1366-665885-666-22650")[code]....
View 1 Replies
Apr 5, 2011
I need to send a short string, (less than 30 bytes, but sent every second), from one VB application, to a Delphi application.. is this possible, using CopyDataStruct, WM_COPYDATA and SendMessage functions in Windows?
View 1 Replies
Nov 10, 2011
I want to exit my GUI application (vb.net 4) using a commandline parameter.I should send thive! from the commandline:
myapplication.exe quit and an already running instance of the application should exit.
Now, I have a mutex detection in place so that I can only have one instance of the application running at a time. It seems that if I send a commandline, it won't work on an already running application; it will only work on one that is launching.
View 3 Replies
Jan 13, 2011
I'd like to, let say "declare" my custom command, and what do I mean by command is something you type in the code, when for example you click a button. Just like Textbox (for example), my custom command sould have "underthings" in it, so just like I can type in Textbox1.Text. And that underthing (in this example, textbox is my custom command and .text is a sub/underthing) I can set if it is a boolean or string etc. I need this for my login program, where that custom command is an username (named username, what you can dim), and then it has sub things, like username1.email (string for e-mail text) and username1.password, username1.ismoderator (boolean, true or false). So an example, in my program I can do like this:
'Username is my custom command, just I don't know how to'define or declare it.'Username has here, to keep it simple, 2 sub things, it is'username.password and username.name Private Sub btn_registrate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_registrate.Click'When the button called registrate (make new username) is clicked Dim username1 As Username'(I don't know if it must be dim blabla as NEW or without new with'my custom command)username1.name = Textbox1.Text 'Textbox for username username1.password = Textbox2.Text 'Textbox for password
View 3 Replies
Apr 27, 2011
my code is giving me a serious problems i thought my code has worked prefectly but theresulting valuesare not corresponding with the typed sentences in the text box .i thought when i had trimmed my sentences the code would work but thatis not the case now .i am requesting full assitance with my code is displayed here:
Dim txtInput
As
String =
[code].....
View 8 Replies