Using Command Prompt in Visual Basic - vb.net

I am trying to create an application in visual basic to open up a command prompt. I then want to type the word "Message" into the command prompt and have my application recognize the word "Message" and then run my application.
Any help leading me into the right direction would be greatly appreciated. Do I need to create a batch file or something else for this to work? Any advice, articles, or sample code is greatly appreciated. This is all new to me. I don't have much code, but this is what I have in visual basic:
Process.Start("cmd")
If (cmd.CommandText = "Message") Then
'calls another class to actually run the program
End If

It's the classic, good news and bad news.
The bad news is VBA can't do what you want natively. What you need to do is to call the "shell and wait" function, then capture it's output on the standard in.
This will require you to go beyond just VBA, and link into some windows guts (kernel32). The good news is that VBA makes that easy.
While I don't have source for you, a rather extensive article, with code here was referenced in this Stackoverflow Question
Hope this helps!

Related

BC30420 'Sub Main' was not found in 'quicktest4'. after finding that this error could be caused by a install fail I repaired visual studio

so I'm new to visual studio and I wanted to use the visual basic functionality of the program but when I try to compile and run my VB I get the BC30420 'Sub Main' was not found in 'quicktest4' error code. I looked around on the internet to see what could cause this and found that it could be and error with the install itself, knowing that I proceeded to use the repair function in the installer and got the same error. I've also tried deleting the entire program and reinstalling and got no change as well. I also read a post on this website saying that it could be something about the properties so I checked there and did not see anything out of place. Link: BC30420 'Sub Main' was not found error in a Windows Form app
Any help would be appreciated greatly, I really would like to actually start building stuff. this has been a two day ordeal so far.
If it involves adding code, please tell me where because this system is pretty foreign to me.
EDIT: Adding a screenshot of the quicktest code itself
code snippet
Check your properties. Sometimes it sets the initial form to main instead of form 1.

VB Code Equivalent of Batch Code "SET"?

I am making a program that launches an external application, while setting the normally-set Roaming to one of my own folders.
Here is the code in BAT:
set APPDATA=data
To which 'data' is the name of the folder.
However, is there an equivalent of the 'set' code for VB?
Thanks in advance!
Ps. I am new to stackoverflow, so I apologize if I did anything wrong with my questions.

Sharepoint "Export to Spreadsheet" Question

I have just begun programming in VBA and despite my researching efforts have a quick question for the community...
Is it possible to perform the sharepoint action "Export to Spreadsheet" using a VBA macro?
I want to export to excel and create a few pivot tables if you are wondering where I am going with this.
A push in the right direction would be extremely helpful... I wish I had some code to post but I am still in the planning/researching stage.
I would first like to thank #Tim Williams for directing me towards the support.microsoft.com/kb/930006 link as I believe I have found a solution to my question. (If I had enough reputation your comments would be upvoted!)
I was able to generate an .iqy file from the "Export to Spreadsheet" command which I have successfully transferred into a VBA web query. Alternatively, I was able to simply save the .iqy file and open it with the VBA code. Both have successfully populated my spreadsheet so I can now do the reporting I was looking to do.

A GUI frontend for a confusing command-line interface?

Windows XP
The small company I work for just started using this command-line software and it's rather confusing and tedious. I was wondering if it would be feasible to make a GUI frontend and how I would start going about it.
If possible, I would like to have it get data to fill in dropdown boxes and such, but at the very least I'd like to be able to hit a button and perform whatever task. I have never done anything like this before so any help at all would be appreciated.
Thanks
There are two options here:
If the command line exe calls a dll or assemlbly to do the work, then you can work on a front end for the DLL based on the methods that it exposes (ie you can cut out the command line front end completely.
Alternatively you need to wrap the process that the command line runs in and catch its output, and pass it input as appropriate. There's a guide on how to write such a wrapper here: http://support.microsoft.com/kb/305994 (This one is based on writing the wrapper in c#).
One comment though - while it would be possible to do this in VB.Net using the illustrated techniques, doing it in VB6 would be much harder, or even impossible.

IntelliSense not working VS2008 VB.Net

I realize this question has been asked before, but I was not able to find anything that worked for me yet.
Things I have tried:
Switched settings back to default (mulitple ways)
Project Builds/Compiles fine
Closed VS and restarted
The only thing I haven't been able to try is deleting the ".ncb" file, but that's only because I can't find it. In fact not a single one of all our projects have such a file!
So the first question is why can't I find this file in the solution's root directory? The only file I have there besides the .sln is the .suo.
Then if that doesn't work what other options do I have short of un-installing and re-installing?
As for how it happened this might help. While using VS2008 and VSS6.0 (yuck) I made a number of changes to a lot of files via Find&Replace that I didn't mean to(had Entire Solution selected instead of current document). To undo the changes I exited without saving, reopened the solution, then Undid checkout. After that I lost intellisense! I can't imaging how they're related but it might help.
Thanks,
Jeff
IntelliSense usually stops working when it can't compile correctly. Try a new simple project from scratch and see if it works, if it does you have your answer.
Is this for C++ code? If it is, my suggestion is not to try fixing built-in IntelliSense at all, rather try some 3rd party replacement. My favourite is definitely Visual Assist X, which is lot more robust (it almost never stops working, and it is able to parse even very complicated templated and preprocessed stuff, which often makes IntelliSense "lost".
Visual Assist works with other languages including Visual Basic, however this is something I have no practical experience with. Still, there is a free trial - you may try it, I expect it will be superior to IntelliSense even for VB.
Answer:
I figured out how to fix it. Apparently while I was undoing those changes I somehow excluded the file that I wasn't getting intellisense in from the project.
I just right-clicked on it and said "Include in Project" and viola! Intellisense worked again.
Sorry for the false alarm but I appreciate the effort.
Jeff