Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Sending Attachments Using Shell "cmd /c Start Mailto:"

I am facing the problem of attaching a wav / vox file to default mail program using the command below.Shell "cmd /c start mailto:"the above command is done on click of a button and I am able to get the to, subject of the mail except the attachment.any solutions?

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Pleez, Read This!!! Matter Important! "Printing In "DOS Mode" Using "Shell" -not Happening, I Wonder

[I had to repost it since I have not received any replies for my earlier post]

I have a problem.

Following is the code :

Shell(" /c type " & App.path & "matrix.txt >prn")

where App.path is C:XYZ

when the above line is executed, the contents of "matrix.txt" is not printed on the printer. Instead, control just passes on to the next line.

So, to find out why, I modified the line thus.

Shell(" /K")

The above command takes me to the "command prompt". Here, when I give the command "type c:xyzmatrix.txt >prn", which is what the vbcode does, I get the message "file creation error".

So, I have identified the problem. Can anyone tell me why this "File creation error" occurs, And how to solve the problem?

Thanks for reading through.

Choosing &"Start In&" Directory When Using Shell()
How can I set the "start in" directory when launching a binary executable using shell() ? Is there some other function that will allow me to specify the "Start In" path? When I say "start in" - I mean the same path that can be specified in a windows shortcut.

Shell &"start...&" Fails In Win XP
In order to simulate double-clicking on objects, I would use the shell command with "start" at the beginning to mimic the Windows-Run dialog command box...

Shell "start C:Doc1.doc"

But I've found that doesn't work in Win XP. What should I do or use instead to make this work on all platforms?

MS Word - &"Mailto&" And &"SendMail&"
I have a Word form that I would like to email to various recipients.
I would like the recipients to complete the form and then click a submit button to open Outlook and return the completed form to me.

Using "Mailto:" I can get my email address automatically entered but not the attachment.

Using "ActiveDocument.SendMail" the form is attached but not my email address.

How can I get both entered?

Creating Program &"item&" In Existing Start Menu &"group&"
Hi all,

I'm finally at the stage of packaging my application for distibution here at work. When it installs, I don't want it to create a new group in the start menu rather I want to ADD it to an existing group. All of our essential programs go in to a group called "Desktop Applications". During the P&DW, I created a new Group under Programs called "Desktop Applications" and put the program item under that group thinking it would recognize it as an existing group and just add it. Well, apparently I did something wrong because it doesn't add it to this group, nor does it add it anywere else.
Does anyone know how to do this?

Difference Between &"Start&" And &"Start With Full Compile&"...

I feel really stupid asking this question, since it's the first time
I've heard about it...

This is a quote I found searching through google:

Quote:When you compile your project, you most often want to use “Start with Full Compile” rather then “Start”.This is because “Start” only compiles the code you need to execute your project while “Start with Full Compile”compiles all your code.

Exactly what is left out when using only "Start"? I've always used
"Start", and my apps have worked on other systems...



Edited by - D-Race on 3/30/2005 9:47:33 AM

Ending Service Started From &"Shell Environ$(&"comspec&") &"
Hi Everyone,

I am trying to figure out how to close the single instance of the cmd.exe process that is started when I run the below line of code.

Each time I run my program, another instance of the cmd.exe process is left running in my processes. I do not wish to kill every instance cmd.exe because I may be working on something in another cmd.exe process that I do not want to loose.

Is there anyway for my to run the below code then have the process end as soon as it finishes?


VB Code:
Shell Environ$("comspec") & " /k net view > C:view.txt", vbHide

Open Mail Like The Feature "mailto:" In VB6?
In VB6, how would I in the easiest way possible, make a clickable "mailto:" -link?
For example:
I have in my application an about-form. On this form I have my email-adress (lblemailadress). Currently that label is like this:, made it blue, and underlined it. And on mouseover I have changed the cursor to the click-hand of IE.
And on the click-event I want it to to open the default mail client with a new mail-message, and put in the to-box. Just like the feature of "mailto:" when put on a html-page.

The universe is a big place, perhaps the biggest!

If I Use "SaveSetting App.Title, "Settings", "Font", "001122"" - Save Date In The Registry, Where Ca
If i use "SaveSetting App.Title, "Settings", "Font", "001122"" - save date in the registry, where can i find the value saved in the registry? Thanks

Printing In "DOS Mode" Using "Shell" -not Happening, I Wonder Why?!

I have a problem.

Following is the code :

Shell(" /c type " & App.path & "matrix.txt >prn")

where App.path is C:XYZ

when the above line is executed, the contents of "matrix.txt" is not printed on the printer. Instead, control just passes on to the next line.

So, to find out why, I modified the line thus.

Shell(" /K")

The above command takes me to the "command prompt". Here, when I give the command "type c:xyzmatrix.txt >prn", which is what the vbcode does, I get the message "file creation error".

So, I have identified the problem. Can anyone tell me why this "File creation error" occurs, And how to solve the problem?

Thanks for reading through.

Getting File To Install In &"All Users&" Desktop And Start Menu Programs Instead Of &"Current
I am using the Visual Studio 6 Microsoft Development Environment to create an install package. I can get the program short cuts to install to the "Current Users" Desktop and Start Menu Programs folders, but not into the "All Users" area. The "File System on Target Machine" does not seem to give me a way to "All Users" folders, just the "User's Start Menu" and "User's Desktop". Does any one know how to fix that ?



How To Attach A File With &"MailTo:...&"
To lunch send new message to a specific Email adress dialog we call:

ShellExecute Me.hwnd, vbNullString, "", vbNullString, "C:", SW_SHOWNORMAL

How could I include text message or attach a file?

&"Microsoft Shell Controls And Automation&" Vs &"Microsoft Scripting Runtime&"
Hi Guys

Just wondering if any of you know the answer to this:

If I add the reference to "Microsoft Shell Controls And Automation" to my project which already contains a reference to "Microsoft Scripting Runtime".

The reference to "Microsoft Shell Controls And Automation" stops the use of the "GetFolder" methiod.

But when I removed the reference to "Microsoft Shell Controls And Automation" and then add it again, it works fine.

It's just weird, wondering if any of you know the reason?


Solution> Error: &"&"&"&"&H8007007E (-2147024770) The Specified Module Cannot Be Found&"&"&"

This is the error what i am getting after installing a package of one of my module on user testing machine.
The same module being working fine on others.

What can be the reason for this and what can be the probable solution for this?


Method &"SaveAs&" Or &"Save&" Of Object &"Excel.Workbook&" Does Not Work.
Hi people.
I did for a long time a program that uses excel automation, so that from a template will create a final file with some data pulled from the database (with ADO). At the end and when the Excel file is ready to be saved I got in a couple of computers some problems. In the whole LAN have XP, but in these 2 computers we have SP2. I have checked the rights and are OK (I have even tried to save the Workbook under the Temp folder and also the same problem).
Working with Office 2003 (SP1).
I have searched in internet about any bugs but I donīt find anything.
Any ideas.
Thanks for your time

How To Replace &"Apple&" With &"Banana&" In A String That Contains &"Orange&" In A TXT File
Whoa! Long thread title. Basically, how can I search for any string in a text file that contains "Orange", then replace "Apple" with "Banana" in that same string? Is this difficult? Thanks!

Data1.RecordSource = &"select * From Salary Where 姓名 Like &" + S + &" &" * &"&"
Data1.RecordSource = "select * from salary where 姓名 like " + s + " " * ""
thanks in advance gentlemen and ladies..
firstly...I don't know what must add "++" between "s " variant..
who can tell me why?? thanks , ,, I really don't know why it does this..
maybe i am a beginner..please forgive me why add ++ between s..thanks

How To Change Boolean Field From Displaying &"0&" And &"-1&" To &"Yes&" And &"No&"
Hey there,

I have a data report, which displays a few fields from an Access table, one which is a boolean. At the moment if the boolean value is True, then on the data report it displays "-1", and if False "0".

How can I change this so it displays "Yes" if true and "No" if False?

Would be really grateful for any help.

VB6 AddIn Creation - Start With &"ActiveX DLL&" Or &"AddIn&"?

I'm wondering which is the "best" way to start the creation of a new VB6 Add-In. In the New Project creation dialogue should I select "ActiveX DLL" or "AddIn". I know the answer seems obvious but I've read stuff that refers to both starting points, with no explanation as to why choose one over the other. Does it come down to personal preference?

Nick Michell.

Extract Local Names For &"OK&", &"Cancel&" And &"Apply&"

I noticed that some programs written in C++ have an English language, but the captions of the buttons "OK", "Cancel" and "Apply" are in German, Swedish or whatever localized Windows version the user utilizes. Any idea how to obtain the captions of those buttons in VB? The only method which comes into my mind is to get the locale ID and have an array with strings for the the various language versions, but I doubt that those programs do it in that way.


<input Type=&"submit&" Name=&"op-savefile&" Value=&"Save&"> - How To S
<input type="submit" name="op-savefile" value="Save"> - How can you submit this button through visual basic in a webbrowser?

Disabling &"wake Up&", &"sleep&" &amp; &"power&" Button
hello there, how to disable "wake up", "sleep" & "power" button with visual basic? thanks

Start Text File Searching From &"BEGIN&" Keyword
hi all!

can any body please tell me that, i give value from text box and that value will be match in text file starting from 3rd row not from 1st row. Or i mean that the text box value will start searching in text file where "BEGIN" keyword is appeared in text file.


How Can You Return All Strings That Start With &"http&" And End In A Non-letter?
I dont really know how to do this
In a string, how can you return everything that starts with "http" and ends in a non-letter? (ie a number, a " ", a "/", a ".", etc etc etc). there are more than one of these in my string, how can i return them all?

Disabling &"Windows Start + U&" Key (Utility Manager)
How can i disable utility manager shortcut key (Windows Start + U) in windows 2000 through VB code.

Maximizing Screen Size Without &"Windows Start Bar&"
How can you size your form to fit the entire screen minus the height of the Windows Start Bar?


Removing &"Eject PC&" Option From Start Menu
Does anyone know how to either programatically (VB) or through some other means remove the "Eject PC" option for the Start menu? Every now and then I will hit that sucker when attempting to click "Run" and is VERY annoying!! Any ideas would be appreciated....

Windows &"start&" Command Not Recognized In VB On Some Systems?
What I want to do is open a PDF document in the user's installed handler for PDFs. The way we currently do it we open Acrobat Reader 5 from the network. If the user is already running another version of Acrobat, that program intercedes instead.

I have tested the windows "start" command and it works in all the computers. We are calling the program via the Shell command. It looks like there is a different shell for VB? It works in some computers and not in others.

Is there any other way of doing this? Or a way to get the "start" command to work using a different shell, or something?

Shell Works With: &"notepad.exe&" Or &"xyz.txt&" But Not: &"notepad.exe Xyz.txt&
I want my code to emulate the "Start...Run" Windows function; e.g. running either "" or "application.exe" should open "" with its associated program (application.exe).

This code works fine with "" but plays dead with "application.exe".

Any help would be appreciated.

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Public Sub execute(x As String)
ShellExecute MAINForm.hwnd, vbNullString, x, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub

Change Location Of "My Documents" Shell Folder In Windows 2000
I just want to set another path for the location of the "My Documents" special "PERSONAL" folder in Windows 2000 with code in VB. What can I do? Thank you for help me...

Why Won't Shell(&"program.exe /parm 1111 &gt;text.txt&") Work?!
I'm sending comamnds to a dos program and I want it to save it's output into a text file by using >filename which works fine in a prompt but how come it doesn't work when using shell?

Private Sub cmdGenerate_Click()

Dim ProgRun As Long 'Variable to store the ID number.

'Runs the program, returns the ID number, and outputs to a textfile.
ProgRun = Shell(App.Path & "proggie.exe R 1218 >output.txt", vbNormalFocus)

End Sub

My basic idea was to send the output of this external dos app to a text file then load the text file into a text box in my program to display the final output... so does anyone know a way I can either get this dosapp to output from inside visual basic into a text file the way ">filename" would work from a command prompt or anyway to get visual basic to capture it's output as string data for a text box?...

&"Shell Rundll32 Rnaui.dll,RnaDial&" Opens Two Windows??
Two dialup windows open when I do the following:
Shell "rundll32.exe rnaui.dll,RnaDial " & strConnectName

This causes a problem when using SendKeys "{ENTER}",1 to start the connection process.

Anybody have any suggestions on how to fix this problem or how to force a connection without the users input.
(I do allow the user to choose the dialup connection they want, hence strConnectName)


Set Notepad Font Type Before Open It Using "Shell" Command.
May i know whether i can set the font type and font size
of application Notepad before i open it in VB using command
If i didn't set the font type, the file opened will run out of

Thanks for any help.


Using Shell To Open Adobe Acrobat - &"Minimize&" Option Doesn't Work.
Hello, Everyone,

I've run into a problem with the following scenario:
From my Visual Basic 6.0 application I try to open several pdf files, one after another. The way I do that is by using Shell command to launch Adobe Acrobat application together with a given file. This is a sample VB code:

VB Code:
Dim Adobe_Acrobat As String  Dim PDF_Files_Path As String  Dim File_To_Open As String   Adobe_Acrobat = "C:Program FilesAdobeAcrobat 7.0AcrobatAcrobat.exe"  PDF_Files_Path = "C:TEMP"   For i = 1 To 5     File_To_Open = PDF_Files_Path & "TestReport" & i & ".pdf"     Shell Adobe_Acrobat & " " & File_To_Open, vbMinimizedFocus  Next i

The default action for the Shell command is to launch Adobe in the Minimized form. However, even if I specify the 'vbMinimizedFocus' option in the Shell command above, the Adobe window pops up on the screen wide open for every pdf file above (five times in this case). Even if you minimize the just opened Adobe window when the first pdf is displayed, it comes back up for the 2nd pdf and all subsequent ones. This happens for Acrobat 5.0, 6.0 and 7.0 versions.
The expected behavior should be that Adobe window remains Minimized and just gains focus in the Taskbar. I've tested exactly the same 'Shell' command with Notepad and it worked just as expected - Notepad opened all five text files but remained minimized in the Taskbar.

Does anybody know why the "Minimize" feature is not working with Adobe Acrobat, and is there a way to make it work?

Thank you in advance for your response.

Getting The File &"Type&" Descriptions (i.e., &"doc&" = &"Microsoft Word Docume
Hello there,
I am creating an Explorer-type Listview to display the files in a directory, and one piece of info I need to know how to obtain is the file "type" (i.e., "doc" = "Mircosoft Word Document", "xls" = "Microsoft Excel Worksheet", etc.). Is there an API, or does anyone have a technique to do this? Thanks.

Changing The &"title&" Of A VB Created Word Doc From &"Document1&" 2 &"BadgerBai
Ok, when I create a new word doc it automatically takes on the name "DocumentX", where X is a number greater than 1.
What I want to do is change this by using something like:

VB Code:
Dim objWoof As New Word.ApplicationDim objGrowl    As Word.Document    Set objGrowl = objWoof.Documents.Add    objGrowl.[What Property] = "Badger Baiters R Us"

Is this possible?

Oh, and b4 anyone mentions it, I do NOT want to save it, that is NOT an option...just getting that out the way now



Resubmitting: "BeginTrans" , "CommitTrans" And "Rollback With Data Environments
----- Original Message -----

From: shankar [ babu ]


Sent: Wednesday, February 26, 2003 12:24 PM
Subject: "BeginTrans" , "CommitTrans" and "Rollback with dataenvironments

hello everybody,
I am using data enviroment designer in my project.

I am getting error while using
"BeginTrans" , "CommitTrans" and "Rollback"
of the DataEnvironment 's connection properties

kindly let me know the solution
thanks in advance

Runing The &"run&" Command In Start Menu
i want a to make a program that will open the run input box and type something in it and press enter. If i didnt make myself clear enough when i say "run input box" i m,ean the option on the start menu. I want it to enter "calc.exe" for example.

Can ASP Script On Website &"start&" App On My Computer

My client application sends data to ASP scripts on my website, which acts on this data, stores it in a DB, and "replies" to my client app.  I am quite comfortable with this.  My question is:

Can an ASP script on my website "call/activate/create an event in" my client app (which is running, but not "looking" for anything) when it (the script) is ready to send the app some information?  I am trying to keep from having the app always looking at the website for new data to act on.


Ortho    "you cain't fix 'stupid'..."

&"Illegal Operation&" Issuing DOS Command Via $SHELL
I'm stumped and am desperate for answers.

I'm running a basic interpreter (Not VB) on a stand-alone Windows 98 machine.

I execute a $shell command to execute simple dos file commands- ren, copy, del.

Once in a while the dos command does not work and I get "Illegal operation" along with a help button. the help button opens a window that suggests possible problems. Nothing of any use.

I WAS able to duplicate the message by opening a dos window and issuing the command at the dos prompt.

This is not directly related to VB but I'm going everwhere to find some clue as to the answer.

Launching An Executable With &"shell&" Without Displaying The DOS Window
I have a VB program that runs an executable in DOS using the shell function.

It runs fine, but it shows the DOS window whilst the program is running. I want to call the exe without displaying the DOS window as this will simply confuse the user.

"cmd /k" is the command switch to run the execuatabe and leave theDOS window open after the exe has finished running.

"cmd /c" is the command switch to run the execuatble and only show the DOS window whilst the exe is running.

But what is the command switch to simply run the exe but without showing the DOS window at all?

SendKeys, Appactivate, Shell(&"myprog.exe&",1), App.title Etc
Hi, can any one help me please, I would like to use some VB code that will allow me to use the SendKeys function when I click on another Window out side of my program.

What I am actually looking for is a way when I click on a window, say notepad, it sends the notepad's title bar Caption "Untitled" for example to my application, or any window that I click on, so that I can use SendKeys to that application.

Any help will be greatly appreciated, I would like to say a BIG THANKYOU in advance to those who read and reply to my posting.

Regards ElevenSixtyFour

Have a great day

Executing Games/apps Using &"shell&" Command?
1. i run an lan games lounge and i have been trying to make a program so that when i run it all the lan players have to do is to press a button and the corrasponding game will run.

2. i also need this program to be non exitable(as i don't want people mucking up the computers) "any suggesions" (i have maximized it and taken out all of the exit and minimize buttons)

OK, i have made the program and some games run using this shell command retval = Shell("D:RavenShieldsystem
avenshield.exe") but some games don't and i can't figure out why?? they either don't run at all OR come up with an error can't load a certian file.

i need help i have tried everything.

why do shortcuts on the desktop ETC work and i can't run some of the exe's from my VB program.

thanks in advance

How React To Windows &"Send To&" Shell Cmnd?
I have a simple file editor and I'd like to be able to take advantage of the Windows "Send To" feature.

Right now, when you invoke "Send To" and my app is not running, it starts my app and I load the file (using the _Load event and Command() ).

But once it's running I'd like to restrict multiple instances (If App.PrevInstance Then End ), and still be able to respond to the "Send To" command and open the file.

Is this possible?


How Do You Shell &"Local Disk Properties&" Applet?
just like

Call Shell("rundll32.exe shell32.dll,Control_RunDLL timedate.cpl")

brings up the timedate window. I need to bring up the "Local Disk (C Properties" but I haven't found the code yet. anyone know?

Another How Do I Q... Make A SELF MADE Browser Navigate Like You Can IE Using &"Shell&"

Shell "PathToIE.exe http://MySite.Com"

That makes IE Load, And Navigate To http://MySite.Com

How Can i make the "VB Browser" do the same?

I Wanna know this for a basic reason....

I Wanna make a "Built in" Browser for an app, so the user can add it to a "Database" as they surf

(A "Project" im working on )

I would add it to the actual Application, but i want the Application itself to be as "Compact" as possible, BUT only have the browser for those who "Want to install the function".

So IF its possible Please Tell :P

(As always EXAMPLES are GOOD :P)

SHELL &"rundll32 Keyboard,disable&" - HOW DO I RE-ENABLE?????
I saw a post from Megatron that showe how to disable the keyboard with this command:

SHELL "runndll32 keyboard,disable"

But I don't know the command to re-enable the board.

I already tried:

SHELL "runndll32 keyboard,enable"

Please help. Thanks.

&"References&" Needed For Running WScript.Shell
Could anyone tell me what "References" are needed to run a "WScript.Shell" object?
I am using Windows XP, VB6. Thank you!

Can Someone Guide Me On How To &"PUT&" A &"CHECKBOX&" Inside A &"Datagrid&" For VB6.0?
Can someone guide me on how to "PUT" a "CHECKBOX" inside a "Datagrid" for VB6.0?
please i need these to complete my program security....................for my thesis? please please!!Can someone guide me on how to "PUT" a "CHECKBOX" inside a "Datagrid" for VB6.0?

Copyright Đ 2005-08, All rights reserved