run .exe from web service - looking for ideas

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • Re: Files and Folder Permissions
    ... Without knowing exactly what you are trying to accomplish all I can say is - try the various settings until you get the combination that works for you. ... You may want to play with a test folder until you figure out what works. ... Finally would I need to select the Replace permissions entries on all child ... If the users are running programs like Office that create temp files ...
    (microsoft.public.windows.server.general)
  • Exch07/OL07: Change Calendar Permission for All Users, Free/Busy T
    ... We have been given a task which we are not quite sure how to accomplish. ... I think what needs to change is the Default permissions on the Calendar from ... Default = Free/Busy Time to Default = None. ... to manually set permissions in Outlook on each user’s Calendar permissions to ...
    (microsoft.public.exchange.admin)
  • Web service hosting options
    ... Here's what I'm really trying to accomplish: ... Running IIS to expose our web service to the world poses several challenges ... because I need to run my app on some Windows 2000 computers (in addition to ... a bunch of Windows XP computers). ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Secure updates.
    ... modifiy the ACL to accomplish the restriction you seem ... interested in verifying. ... on the records it has defined, which same permissions are not ... "mike" wrote in message ...
    (microsoft.public.windows.server.dns)
  • Remote Application Restart
    ... uncommon task that I could not accomplish in VB.net. ... server side code, and the application I want to "kill" is on the ... remotly restart an application with a simple ASP.net app? ... If a web service is the answer does anyone know of a simple example as ...
    (microsoft.public.dotnet.framework.aspnet)