Run File Open Command?
Feb 16, 2012I am running an application from my desktop as you see on the picture,and I don't know how to run File Open command on active form without mouse click,only with vb.application?
View 11 RepliesI am running an application from my desktop as you see on the picture,and I don't know how to run File Open command on active form without mouse click,only with vb.application?
View 11 RepliesI am running an application from my desktop as you see on the picture,and I don't know how to run File Open command on active form without mouse click,only with vb.application?
View 1 RepliesI know the "Process.Start" function, but it creates a new object of the cmd shell which terminates itself when the Python script is at its end. How can i open the original Windows Command Shell so that the Python file can run to its end without the box getting closed?
View 6 RepliesCan you specify more than one open= command in the autorun.inf file?
This is what I am using and it only executes the first file open= command:
[autorun]
open=install.exe
icon=install.exe,0
open=xcopy usermanual.pdf c:Program Filesinstall directory
open=notepad readme.txt
i use this command to open my ms access database file, but it is not working, what is the problem.... i learn this command from internet tutorials. [code]
View 3 Repliesi am trying to open a excel 2007 file using a shell command in visual studio .net 2008 from a button object but it says "File Not Found" even though I created the file and put it into the same folder as the application.
View 2 RepliesI am using the following code to run defrag and to analyze if the C: drive requires defragmentation:
Dim analyze As Process = System.Diagnostics.Process.Start("C:WindowsSystem32defrag.exe", "C: /a /h /u /v")
This process runs through analyzing, runs it in normal mode & prints the progress to the command window.
My problem is that as soon as the process is complete the command window closes. I need it to stay open so that I can read the results.
I'm starting to make a program that will run some commands, so i need some code that will open command prompt and run the command "netstat -a".
View 11 RepliesI have an application that can read certain types of files, and I have it working so that if you do "open with" from windows, it automatically starts the application and opens the selected file.
Unfortnately, I cannot get it to work for more than one file.
System.Environment.GetCommandLineArgs() contrains the following:
System.Environment.GetCommandLineArgs(0) = name and path to the .exe
System.Environment.GetCommandLineArgs(1) = name and path to the first file selected to be opened
System.Environment.GetCommandLineArgs().Length is 2 when the user tries to open 1 file, which makes sense since the first argument is the .exe itself and the 2nd is the path to the file, but it does not increase to 3 if the user tries to open 2 files... meaning that System.Environment.GetCommandLineArgs(2) is never populated Here is some sample code that shows the problem: It will recognize no files or 1 file being opened, but if you try to open multiple it will only show the first.
[Code]...
There is already an open DataReader associated with this Command which must be closed first
Dim staffid = TextBox1.Text
Dim conn As New SqlConnection
conn.ConnectionString = SqlDataSource1.ConnectionString
[code]....
I just started playing around with VB today and have been working on getting a very simple program running. I am trying to create a program where when I hit a button it will open a command window and run a command. I have worked on this for a a good portion of today, and have not been able to find a solution to do this.[code]I have been through a few other things to get it to work, but nothing has seemed to work. Is there a better way to go about this? it seems like it should be simple, but I'm just missing it.
View 8 RepliesI am trying to build a word add in to add xml files to documents, I am under the assumption that Microsoft.Office.Interop.Word.Application.ActiveDocument will work with the document being used, but when I try to use the add in I receive the error: "this command is not available because no document is open " o:
Dim activeDoc As New Microsoft.Office.Interop.Word.Application
Dim currentDoc As Microsoft.Office.Interop.Word.Document = activeDoc.ActiveDocument()
the second line.
I have two datareaders: [Code] When i'm running the code i get this error in the highlighted line: "There is already an open DataReader associated with this Command which must be closed first." I used different variables in both readers, why do i get this error? do i have to open a new sqlConnection for this task?
View 13 RepliesI am trying to open a cmd window as an admin but it never works. I can open a command window but it does not open as the admin.. Here is my code (VB.NET 2008)..
'This is in a module Public strUserName, strPassword, strDomain As String Public SecPassword As New Security.SecureString() Public impersonater As New ProcessStartInfo()
[Code]...
Ok...i have read all posts..and no solution...on main form I have...
adapSB.Connection.ConnectionString = "Password=xxx;Persist Security Info=True;User ID=xxx;Initial Catalog=dbone;Data Source=xxx
adapSB.Fill(DTSB)
and in class that starts new thread started every time users change some data(very often)
[Code]...
1. other parts of application are targeting other SQL server...just this adapter is updating only one row(table has two columns, some id and last time any of users changed something.
This reader is done in the form load event and is the very first thing done so I don't understand why it's telling me there is an open DataReader. I've also set MARS=True in my connection string so obviously it is something else.Here's my code and like I said the routine is called at the top of the form load event. The error occurs on the
Reader_Customer = command.ExecuteReader() line:
Module Globals
Public g_strConnectionString As String = "workstation id=" & System.Environment.MachineName & ;" _ & "packet size=4096;Connection Timeout=60; " _
[code].....
I'm trying to figure out the script needed being executed by a button element (or some kind of element) to launch another windows form from the same project when being in another windows form? I'm a bit of a beginner with this language, so I don't know simple scripts like this one
View 4 RepliesI get the following message "There is already an open DataReader associated with this Command which must be closed first." Is the insert statement the most effiecient way to write to the table row by row?
Dim comment As String Dim cnx As Data.SqlClient.SqlConnection = SqlCnx.SourceDB Dim cmd As New Data.SqlClient.SqlCommand("select number,comment from [Comments]", cnx) Dim daComments As New SqlClient.SqlDataAdapter Dim bsComments As New BindingSource cmd.CommandTimeout = "360" cmd.CommandType = CommandType.Text cnx.Open()
[code]....
I am trying to open a cmd window as an admin but it never works. I can open a command window but it does not open as the admin.. Here is my code (VB.NET 2008)..
[Code]...
how to open excel with switches using vb.net, similar to what "Run.." does in Windows.. eg: this is what you would put in the "Run" ComboBox : excel.exe /r "C:ook.xls"
View 1 RepliesI have both the VB and C# versions of Visual Studio 2008 Express. When I run a console application in either version, instead of the console opening in an old DOS style command window like it does in VS 2005, it actually blacks out both monitors attached to my computer and treats the entire screen real estate as the console.Anyone know how to get the app to run in a small command-type window when I run it? It's like the console is running Full Screen. If I set a break point, switch from the IDE t the console and then hit Alt+Enter it switches to the small window that I want, but I still can't figure out how to make the app start with the console that way.I could post a screenshot but it would look like a big black square...no window, no frame, just the inky blackness of frustration.
View 2 RepliesI am trying to do a runas command but it will not let me pass all the variables instaead it brings up a command prompt asking for a password how can I wait for the command prompt to come up and pass the command variable to the console? variable I need to pass is aPwd
[Code]...
I'm trying to put together a quick example for another thread about treeviews, and I'm getting a problem when I have a recursive routine, getting the message.
Quote:
There is already an open DataReader associated with this Command which must be closed first.
I'm a tad confused as I am explicitly creating a new command every time through the loop, so I'm not sure (unless its something ADO is doing behind the scenes) how the datareaders higher up the tree are interfering.
Here's my code :
Private Sub SetupChildren(ByVal ParentID As Integer, ByRef ParentNode As TreeNode)
Dim MyCommand As New SqlCommand("SELECT * FROM Groups WHERE ParentGroup=@ParentGroup", m_myConnection)
[Code]...
Obviously I could close the data reader down before calling the next level of recursion but it would prevent the code continuing the loop at the current level when it had finished processing children.
when i use the "anything.show" command, it will always open in a new window... How can i make it open in the same window?
View 11 RepliesWhy would a .sln solution file open and appear empty in Microsoft Visual Basic 2010 Express - i.e. no windows showing projects and code files etc.When I inspect the file in a text editor, it contains references to vbproj files (which are present) which indicate that it should not appear as empty.No error messages are reported when the file is opened.
View 2 RepliesI would like to open the excel file after create the excel file. The creating file function is done, but the system unable to open the excel file. My coding as below:
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim misValue As Object = System.Reflection.Missing.Value
[code]....
how to use open file dialogs to open a file to a text box?
View 6 RepliesI've noticed that when you click on a web page in Windows Explorer, or open a file in general, and the default application to open it is internet explorer, ie opens and opens the file. However, when I tried this on my Web Browser it opened, but ignored the file and went on its usual routine. How can I get my Web Browser to open and open the file that was clicked on in explorer?
View 1 RepliesI saved a file with the extension .doc. I use the RichText to write and save the text. I did not set any encoding type when I saved it. When I tried to open the file in the Richtextbox again, I got all the formatting characters in the RTF file. How do I correct this? How do I open and re-open a .doc file in the Rich Text box control without the formatting showing up in the box with the document contents?
View 4 Repliesim having a slight problem with my open file dialogue box, i need to be able to open the dialgue box, and click the file and open in my pdf reader, or at least load it to my other form ive created. what ive go so far:
[Code]....