Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8765491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:17:50+00:00 2026-06-13T16:17:50+00:00

I am having trouble getting an exe to work from an exec master cmdshell

  • 0

I am having trouble getting an exe to work from an exec master cmdshell statement in sql server.

The EXE works fine when I double click it. But when I try to run it with this command in SQL server it does not execute.

EXEC master..xp_cmdshell 'Path\Program.exe'

The program itself is very simple–it is just supposed to send an email alert using an in-house DLL. If it hits an error, it should write that error to a file in the current directory. (Eventually, I want it to set it up to run via a trigger when records are inserted into a particular table).

When I run the program with the statement above, the program does not print out an error message (as shown below) or send an email. How can I tell if it is executing? Hitting an error? What could be going on? The program itself is working properly when I run it via double clicking the path\program.exe.

Imports System.IO

Module Module1

    Sub Main()
        Try
            EmailSenderDLL.EmailSender.send(15, "Alert Text.")
        Catch e As Exception
            File.WriteAllText(Directory.GetCurrentDirectory() & "\" & Now.Year & Now.Month & Now.Day & Now.Millisecond, e.Message & vbNewLine & e.StackTrace)
        End Try

    End Sub

End Module

What steps can I take to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:17:51+00:00Added an answer on June 13, 2026 at 4:17 pm

    Yes, you can use database-mail with a google account: https://blogs.msdn.com/b/suhde/archive/2009/07/12/how-to-configure-sql-server-database-mail-to-send-email-using-your-windows-live-mail-account-or-your-gmail-account.aspx?Redirected=true

    Make sure you open the right port (587) in you firewall to allow SQL Server to talk to google.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having trouble getting the following code to work. Calling swapLevel() directly works fine, but
I'm having trouble getting the following to work in SQL Server 2k, but it
Having trouble getting this to work: /// <summary> /// Retrieve search suggestions from previous
im having trouble getting a string (containing a URL) from one activity to another.
I'm having trouble getting the CanExecute method of my command to work property. I've
I'm having trouble getting the server to recognize a JSON POST request since I
I am having trouble getting my application to work correctly. I am trying to
I'm having trouble getting rmagick to work on windows. Does anyone know how to
We are having trouble getting Spring Security/Kerberos/AD to work for our web app. Our
Having trouble getting the oauth access token and secret exchanged from the request tokens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.