CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Feb 2003
    Location
    Greece
    Posts
    533

    shell() strange problem

    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().

    Code:
    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
    Last edited by dtv; December 11th, 2008 at 07:07 PM.
    - Better live in the digital world -

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

Featured