|
-
Sep 9th, 2004, 09:15 AM
#1
Thread Starter
New Member
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:
Shell(comando, AppWinStyle.NormalFocus)
and
VB Code:
Dim pro As New Process
pro.StartInfo.FileName = "C:\windows\calc.exe"
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
-
Sep 9th, 2004, 09:29 AM
#2
Addicted Member
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.
-
Sep 9th, 2004, 10:27 AM
#3
Thread Starter
New Member
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:
<WebMethod()> Public Sub EjecutarEXEC()
Try
Dim p As New AspExec.Execute
p.Application = "C:\windows\calc.exe"
p.ShowWindow = True
p.ExecuteWinApp()
p = Nothing
Catch ex As Exception
Throw
End Try
End Sub
Thanks again
Last edited by lobillo; Sep 9th, 2004 at 10:33 AM.
-
Sep 9th, 2004, 10:35 AM
#4
Addicted Member
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
-
Sep 9th, 2004, 10:56 AM
#5
Thread Starter
New Member
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
-
Oct 12th, 2004, 12:28 AM
#6
New Member
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?
-
Oct 12th, 2004, 03:13 AM
#7
Why on earth would you want to launch calc.exe on the IIS server???? Makes no sense.
Do you want to launch calc on the PC the client is using?
Woka
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|