run .exe from web service - looking for ideas

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default run .exe from web service - looking for ideas

    Hello everyone, I am trying to accomplish something, and the way I had
    intended is not working out, so I am looking for ideas.

    Here is what I am trying to accomplish. I must preface this by saying
    that I am new to iis and iis security.

    I have a .exe that must stay on the server. I would like people to be
    able to run this .exe with specified parameters/switches without
    interacting directly with the server.

    I had thought to use a web service to accomplish this, but I am running
    into permission problems. Here is my web service; if it helps to
    explain (I have tried both versions):

    <WebMethod(MessageName:="Unsigned")> _
    Public Overloads Function Encrypt(ByVal a_strEncryptKey As String,
    _
    ByVal a_strDestPath As String, _
    ByVal a_strFilePath As String) As String

    Dim strReturn As String

    Dim objProcess As Process
    Dim objProcessInfo As ProcessStartInfo

    Try

    objProcess = New Process()
    objProcessInfo = New ProcessStartInfo("pgp", "-ea """ +
    a_strFilePath + """ """ + a_strEncryptKey + """ -z secretkey")
    objProcess.StartInfo = objProcessInfo
    objProcess.EnableRaisingEvents = True
    objProcess.Start()
    objProcess.WaitForExit()

    Catch ex As Exception
    strReturn = ex.ToString
    End Try

    Return strReturn

    End Function


    AND

    <WebMethod(MessageName:="Unsigned")> _
    Public Overloads Function Encrypt(ByVal a_strEncryptKey As String,
    _
    ByVal a_strDestPath As String, _
    ByVal a_strFilePath As String) As String

    Dim strReturn As String

    Dim objProcess As Process
    Dim objProcessInfo As ProcessStartInfo

    Try

    objProcess = New Process()
    objProcessInfo = New ProcessStartInfo("cmd.exe")
    objProcessInfo.RedirectStandardInput = True
    objProcessInfo.RedirectStandardOutput = True
    objProcessInfo.UseShellExecute = False

    objProcess = Process.Start(objProcessInfo)

    objProcess.StandardInput.WriteLine("pgp -ea """ +
    a_strFilePath + """ """ + a_strEncryptKey + """ -z secretkey")
    objProcess.StandardInput.WriteLine("exit")
    strReturn = objProcess.StandardOutput.ReadToEnd
    Catch ex As Exception
    strReturn = ex.ToString
    End Try

    Return strReturn

    End Function

    It works if I try these in a windows application, that's why I
    believe the problem to be permissions related. I have tried mucking
    with the security on the pgp.exe file, the .net framework configuration
    thingy, and I'm sure other permissions settings. Not really knowing
    what I'm doing makes it a frustrating 'shotgun approach' (hoping
    something will work).

    So now, I am looking for any suggestions on how to make the web service
    work or a better way to accomplish this. I hope this makes sense; my
    head is a little sore from banging it against the keyboard :)

    Thank you for any help.

    Have a great night!
    Ryan

    ryan.mclean@gmail.com Guest

  2. Similar Questions and Discussions

    1. PLEASE help with ideas
      Okay the situation is as follows... I would like to create a web site, almost like a site for friends to make accounts and gather and so forth. I...
    2. web service error from flex ProxyServlet - any ideas?
      We are getting an intermittent error when calling web services via flex. Our server is IBM websphere. It appears that a request with no data is...
    3. X ideas
      Hello Looking to run X windows on a debian 3.0 for a older machine with a 4 meg video. Its for a server so i want a smallest x server to take up...
    4. Any ideas on this?
      How would i go about creating this? I have a table, within each cell there is an image spacer set to 20 x 20 px the same dimensions of the...
    5. Any ideas
      IDS 9.21 FC4 on HP-UX. Application: Lawson I've never seen this before. The application is inserting some rows into table dsinvlines, according...
  3. #2

    Default Re: run .exe from web service - looking for ideas

    I am having the same problem. My call to exe runs perfectly from a
    windows app but not from the webservice. Though my tester exe did run
    from web service too. Did you find a solution to this problem. If so
    please let me know.
    The following was my post on microsoft.public.dotnet.framework

    [url]http://groups-beta.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/ce9ee898c6dfb6a1/137782204bd85cf5#137782204bd85cf5[/url]

    Thanks.

    pri Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139