Results 1 to 7 of 7

Thread: Launch Application from WebService

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2004
    Posts
    3

    Launch Application from WebService

    Hi! Can I launch an exe from a WebService? I've tried with Shell and with the process class:
    VB Code:
    1. Shell(comando, AppWinStyle.NormalFocus)
    and
    VB Code:
    1. Dim pro As New Process
    2. pro.StartInfo.FileName = "C:\windows\calc.exe"
    3. pro.Start()
    The process "calc" exist in the Task Manager->process but nothing else. I cann't end the process (Access denied).
    Any Idea?
    Thanks

  2. #2
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    First check to make sure the IUSR account for IIS has execute permissions on the file.

    Try:
    Code:
    Dim info As ProcessStartInfo = New ProcessStartInfo("C:\windows\calc.exe")
    Dim p As Process
    p.Start(info)
    That might work better, but I wouldn't count on it
    Or:

    You could try using ASPExec:
    http://www.vbforums.com/showthread.p...hreadid=304204

    You should be able to change the code to fit your needs very easily.
    ~Ryan





    Have I helped you? Please Rate my posts.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2004
    Posts
    3
    Thanks, but the problem continue. The process exist, but not the application.
    How can I check if the IUSR account for IIS has execute permissions on the file (for example) "C:\windows\calc.exe"?
    this is the code in WebService

    VB Code:
    1. <WebMethod()> Public Sub EjecutarEXEC()
    2.         Try
    3.             Dim p As New AspExec.Execute
    4.             p.Application = "C:\windows\calc.exe"
    5.             p.ShowWindow = True
    6.             p.ExecuteWinApp()
    7.             p = Nothing
    8.         Catch ex As Exception
    9.             Throw
    10.         End Try
    11.  
    12.     End Sub

    Thanks again
    Last edited by lobillo; Sep 9th, 2004 at 10:33 AM.

  4. #4
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    Navigate to C:\windows\

    Right Click on calc.exe
    --> Go to Properties
    ----> Click the Security Tab
    ------> If you don't see IUSR Click Add and add him
    ~Ryan





    Have I helped you? Please Rate my posts.

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2004
    Posts
    3
    The Drive C is FAT32... I copy the file to D (NTFS) and I add the user but nothing happen. I have 6 process 'calc.exe' that I cann't terminate, but that's all.
    Thanks

  6. #6
    New Member
    Join Date
    Oct 2004
    Location
    Culver City, CA USA
    Posts
    8

    Question

    Any idea how to do this in C#? I have the AspExec.dll installed on the web server, but I can't figure out what type to use for the variable that I'll need to use to store the Execute object. If there's no way to do it in C#, is there a way to call a VBScript from a C# function?

  7. #7

Posting Permissions

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



Click Here to Expand Forum to Full Width