dtv
December 11th, 2008, 06:03 PM
Hi
I have a very strange problem with the Shell function within a asp.net web application (vb.net pro 2003).
In a web form's button click event, i am using Shell somewhere in the middle to run-and-wait an exe program (its a vb6 executable which handles some local files and returns an output file with some results in it).
The problem is that the specific program wont run at all when i am calling it with Shell.
If I run it from the windows explorer by double clicking it, it runs ok. Shell does nothing and skips to the next command (in that case shell returns 0). I've tried to use the Diagnostics.Process.Start and I am getting an exception saying something about win32...blah blah permission error.
The project runs in a folder "webtools" inside the wwwroot main folder.
The specific exe is located in the webtools folder itself, the root of the application that means.
Do you have an idea? I've tried also to set even read/write/execute permissions for the webtools folder, but still the same. Its not something about that exe file, i even cant run the notepad.exe if i place it to the webtools folder.
Try it yourself. The following is not working at all at least on my computer with the current vb.net pro 2003 installation. I never had any kind of problem making web applications but i think its the first time i am using shell().
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Shell("C:\WINDOWS\NOTEPAD.exe", AppWinStyle.NormalFocus)
End Sub
I have a very strange problem with the Shell function within a asp.net web application (vb.net pro 2003).
In a web form's button click event, i am using Shell somewhere in the middle to run-and-wait an exe program (its a vb6 executable which handles some local files and returns an output file with some results in it).
The problem is that the specific program wont run at all when i am calling it with Shell.
If I run it from the windows explorer by double clicking it, it runs ok. Shell does nothing and skips to the next command (in that case shell returns 0). I've tried to use the Diagnostics.Process.Start and I am getting an exception saying something about win32...blah blah permission error.
The project runs in a folder "webtools" inside the wwwroot main folder.
The specific exe is located in the webtools folder itself, the root of the application that means.
Do you have an idea? I've tried also to set even read/write/execute permissions for the webtools folder, but still the same. Its not something about that exe file, i even cant run the notepad.exe if i place it to the webtools folder.
Try it yourself. The following is not working at all at least on my computer with the current vb.net pro 2003 installation. I never had any kind of problem making web applications but i think its the first time i am using shell().
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Shell("C:\WINDOWS\NOTEPAD.exe", AppWinStyle.NormalFocus)
End Sub