VS 2010 Get .bat File Output?
Jul 29, 2011I'm coding a program & the program runs a .bat file with this content :
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
[code].....
I'm coding a program & the program runs a .bat file with this content :
@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
[code].....
Unable to write to output file 'D:DevelopmentJob_TrackerJob_List_and_TrackerobjDebugJob_List_and_Tracker.exe': The process cannot access the file because it is being used by another process. Job_List_and_Tracker
View 6 RepliesI'm working on an application with 4 combo-box's, "go" and "quit" buttons, and a Multi-Line textbox.The combo-box's are prefilled with options for the user to select and I'd like all of the output to come up in the textbox. We are making a data set opossible output responses; it's going to be somewhat of an exhaustive list.When doing the output to the text box using textbox.text = (whatever), is there a way to have more than one line of output displayed in the textbox? I was trying multiple lines of textbox.text =, but only the newest bit of textbox.text = is displayed.
Private Sub btnGO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGO.Click
g_sport = cboSport.SelectedItem
[code]....
I have been searching for a way to format output using writeline/write (streamwriter)using RTF tags and wondering if there is a syntax for this, if it exists. I have not been able to find a resource which clearly explains how to "pretty" up output sent to a file.
The reason why I am asking is because I want to "print" results from my program into a file that, at the very least, would be centered, tabbed and even bolded where possible without requiring the user to go and futz with it. I think I saw that Crystal Reports won't work with VB 2010 Express and, quite frankly, just want to create a file with output.
[Code]...
For a class project I'm supposed to write a program that requests a team as input and displays the players from that team in the first column. The players should be sorted alphabetically by their last name, and if they have the same name they should be sorted by first name accordingly. My program compiles and I'm fairly certain that I've done most of it correctly. The second column should be filled with the batting average of the corresponding player from the left column.
My problems are as follows:
1) I can't get the DGV output to show correctly, it posts the player's name with the batting average of that player in the following downward cell.
2) I'm not sure how to further use the .Split method to separate the first and last name after already separating the name from team/at bats/hits, and can't find any info regarding this topic. Also, I can't figure out how to sort in reverse, I've only seen the Ascending and Descending options so far for sorting.
3) Is the way I've figured the batting average the most efficient/correct way, or is there another better way?
[Code]...
What iam trying to make is an app that would automaticly start two other applications, where one of them needs a single key pressed as input, and copy some link to the clipboard.The application that needs some keys pressed in order to start is this LINK As you can see it looks like some CMD piece of application. i want the output from that window into a TextBox on my form, but have been unable to do that.Ive tried two methods allready.. The most described and used is the RedirectStandardOutput and RedirectStandardInput methods:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim p As New Process
RichTextBox1.Text = "* - Starting Modern Warfare 2 Server Admin Tool"
[code]....
2. This would also store a "log" as the textfile for later use.However the tricky part for me is to:
1. Get the output from the mw2sa.exe window to automaticly update the textfile every few seconds
2. Be able to read the textfile in the textbox. VB tells me its unable to read the textfile as it is beeing used.
3. Somehow if i use the
ProcID = Shell("cmd /K mw2sa.exe > log.txt", AppWinStyle.NormalFocus)
To launch the program all i get is a black cmd window.. However, a log.txt file is created with the correct output, but since the cmd window isnt showing any output i dont think im able to use sendkeys to start the program. And if i try with only
ProcID = Shell("mw2sa.exe > log.txt", AppWinStyle.NormalFocus)
I get the correct cmd window with all the right output. Sendkeys is also able to pass the key to start the program... But no log.txt is created!
I'm getting lat/long values output like: {Lat=51,2833333, Lng=3,45}How do I change the output to 51.2833333 - 3.45 or 51.2833333, 3.45
txt_converted.Text = txt_converted.Text & LatLong.ToString & vbNewLine
The "LatLong.ToString" holds the value/output.
I am working on a program where a user either enters "small" or "large" and then the number of toppings. Once the user has done that my program outputs the total cost of a pizza based on user input.
My problem is no matter if I enter LARGE or SMALL into the textbox for size of pizza the output displays "A small pizza with 2 toppings cost: $x.xx"
It also displays the price of the pizza as a small one. So somewhere along the lines it changes everything to be small.
this problem only started occurring after I made this procedure.
Procedure that I believe is causing problem
Function IisUserInputValidSizeOfPizza(ByRef mytextbox As TextBox, _
ByRef errorMessage As String) As Boolean
[Code].....
I tried google and forum searches and although there is a lot of info and code, they all come up with similar code and not really what I'm looking for and I start to doubt that it's possible....I think it should, but I'm lost. I want to start Robocopy with a button on a form and then see the output in the textbox, just the same as you would see when you would run it from the command prompt. So in realtime, because if I don't see this, it's just like the program is hanging, which it isn't. It's just copying larger files over and waits until it's finished of course Here is the code I have so far (I tried multiple ways):
[Code]...
i try to make a GMFcard i want VB to make a image it must be a generated oneand it must use the template from the own dir like
image.bmp is blank Card it must generate a new card from that with text on it. given by my app.
if thats not possible or to hard is it possible to create a screenshot from the current form
So I got this program to generate me some data and I want to show that data to a label.
If I don't do a display I can generate about 20,000 data per second, but if I do, I get about ~9,000 data per second.
PS. Since the generating logic in is a thread, I have a function that does the displaying to the label.
How would you replace a certain word from input to output? Like, if you type "Tigers are cool" in a text box I want the ouput after a button click to be "Lions are cool", changing 'tiger' to 'lion'. It should also be case sensitive so Tiger would convert to Lion, not lion.
View 2 RepliesWhat I am trying to do: There are three powershell scripts with different time delays as shown below.I am trying to run them asynchronously in .NET and I followed this article to implement Asyncrhonous programming. Where I am stuck:The I am not able to retrieve output after the events are invoked.The scripts are being called but then the program ends and it shows "Press any key to continue" in console windows.I don't what I am missing here.
Info: JobRequest is a class that I use to pass around information keep track of jobs.
Sub Main()
OurAsyncFunctionCalling("psDelayScript2.ps1", "-arg1 4 -arg2 5", 1)
OurAsyncFunctionCalling("psDelayScript1.ps1", "-arg1 2 -arg2 3", 2)[code]......
I have 12 Boolean values in an array. Each of these values represent a CheckBox in my application. I want my program to output a string, based on each value not selected. Each of these values will have a predetermined string that is different from the CheckBox's caption and will be joined to create a final string. I want to generate all the possible combinations for when there are 1, 2, 3, 4 and so on up to 12 of these options at once. I can better explain my problem through the repetitiveness of the code below.
[Code]...
I am new to programming and I am developing a simple application to convert a text which is made using SSML to a audio file,for a personal task. When I use the function
SetOutputToWaveFile or SetOutputWToWaveStream, the file can be created and played using media player, but there is an error in the file. When I use the function setOutputToAudioStream, The audio file can be created, But it can't be played with any media player.[code]...
Is there an easy way in Visual Basic to record values to a CSV (comma separated value) file? I would also consider recording values to an xls or xlsx if it is easier. Anyone have any experience with this? Basically, during a loop, I'd like to take the values of 3 different variables and put them on one line of a csv, then make a new line in the csv and repeat with the next segment of the loop.
View 3 RepliesI want to output some of the data in my VB program to a .PRN file (no commas). I'd like to have the program create a header with the data, parameter info, etc... How does one begin something like this?
View 5 RepliesI'm making a GUI for a console application. I want it to save the file to /data/file.zip to anywhere the .exe is. Process.Start(Form2.TextBox1.Text, "get /folder/file.zip C:patht.zip") So if my application is in C:appmyapp.exe the output file would be in C:appdatafile.zip etc.
View 4 Repliesi have this program i need to make, where it runs a bat file. i got that far, so when i click the button it opens the bat. but 3 problems i encountered i have been trying to resolve for a few days now, the problem is that i need to get the output of the .bat and display it in a textbox, i got that, but it only displays the first and least line... then i need to run the .bat in the background. so you don't see the window.then i also need to be able to hit a second button to close it. the bat is a constant update, lets just say it reads a number then 5 seconds later adds 1 to that number and displays it again. and does this over and over till you close it. that would be a simple description of this
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "C:\Users/jwoow/Desktop/Server/run.bat";
p.Start();
[Code]...
What i have realized is that when you use My.settings, a XML File is put with your EXE when your project is Published.
What you can also do is just Open that File and Change the Variable "Register" From "False" to "True"
How can i do what Most Registration files do, and make the XML File go away and Create a Unwritable file, where the values cannot be changed.
Using visual studio 2010 on a PC running Windows XP SP3 (32bit) I am trying to read the output from a serial device but only get timed out error?If I open hyper terminal I can see the output, so the hardware and connections are good and the command to send data is working as well?When debugging I have no errors, when the program is run (in debugging mode) I get a timed out error from after the do loop (test=2) All I want to do is have my device output printed to TextBoxLockOut.Text? Note "comstring" grabs my com port the serial device is using - on this computer it is com4, it is a public string
Dim inputline As
String = ""
Dim command As
String = ""
[code]....
I have a USB device that is "seen" as a COM Port. It has eight channels, each require a single character to turn ON/OFF. It's a DLP-IO8 for reference. I have the COM port part working 100%.
1-8 turns ON each channel (12345678)
Q-I turns OFF each channel (QWERTYUI)
Truth table for device:
1 = Ch1 ON | Q = Ch1 OFF
2 = Ch2 ON | W = Ch2 OFF
3 = Ch3 ON | E = Ch3 OFF
[Code].....
a loop that I can still use the functions of the form (change speed or Stop loop).
a way to utilize Q-I to turn the channels OFF in random mode
I've been searching for a few days with little luck. I've tried Do Until, Do While loops and a few others.
I've only been coding for a few days now so go easy. Learning as I go. My form for reference
Ultimately I'm trying bring my PC Interface project up to date by going from a parallel port to USB.
Textbox1 will have the number 0x08800000, It may also be more than one line, so for example;
0x08800000 0x02313823
0x08800000 0xDEADBEEF
0x08800000 0xBEEFBEEF
etc etc
I only need to subtract 08800000 from whats in bold, the rest will stay the same. The value in textbox1 will always begin with 0x0880xxxx I need to convert that to 0x00000000 so basically I need to subtract 08800000 from textbox1 and place the output in textbox2.
Since reinstalling VS2010, it has not been displaying proper debug info. I don't think I changed any settings but I have had a hunt through the options and can't see anything I might have messed up. I have had a quikck search and other people seem to have had the same problem but no solution. I'm running Windows 7 x64 with latest updates, if that matters.
View 1 RepliesI would like to create a program that will query all security permission to a given registry path. I attached the image so you have overview. I'm new to VB.Net 1/10 to rate my skill here. This will all the output I will put the output in a listbox or list view.
View 1 RepliesBackground: I'm writing a application that will allow users to enters items on a form using textboxes, radio buttons and checkboxes. I then take each input item and write it to it's own arraylist. After the user is all done entering data the information in the arraylists will write out to a single .txt file.
View 6 RepliesI am executing pdf2text in vb6 but not getting output file my code is
Call Shell("pdf2text -f example.pdf abn.txt")
it does not show any error but not giving any output
I'm having VB write a batch file to send to a remote system via psexec.exe later on in the script. When it goes to execute the batch file, it fails due to these junk characters showing up in the beginning of the first line. I'm creating the file like so:My.Computer.FileSystem.WriteAllText("C:Program FilesBobBob's Programadd_user.bat", "net localgroup """ & Group & """ /add DOMAIN" & UserID, True) Where Group is the local group I'm adding to and UserID is the domain login for the user.
View 7 RepliesI have a data source that creates a continuous stream of 24-bit samples. I can collect a set of samples and build a .WAV file, and play the file through my speakers. What I want to do is eliminate the middleman, and send the stream of samples directly to the sound card. The data source can run for hours or days. I want to hear it in real time, rather than collect it all and listen to it after the fact. The idea is that I can tune the process that creates the data better if I can hear what it's doing.
View 9 RepliesI currently have a system that saves student data to a text file. I can search for individual students and have their information output to screen. How can I make my system output every student in the text file to screen?
View 3 Replies