Executing DOS commands from ASP.NET

Discussion in 'ASP .Net' started by Daniel Portal, Nov 18, 2005.

  1. Hi there,

    I'm trying to execute a DOS command thru ASP.NET.
    I tried to use Console.Write("myCommand") but doesn't seem to work. Does
    anybody knows how can I do it?

    Well if you're willing to help me a little more, I need to start/stop a
    service from ASP.NET Application_Start and Application_End Events (in
    Global.asax).
    I'm havins "Access Denied" exceptions all the time here. Already set the
    Service User with the User in IIS, gave Admin Rights to a determined user
    and tried to place this guy in both places (IIS and Service LogOn User)...
    none worked.

    Thanks in advance.

    Daniel Portal
     
    Daniel Portal, Nov 18, 2005
    #1
    1. Advertising

  2. Daniel Portal

    Brock Allen Guest

    Check out System.Diagnostics.Process and its Start method.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen

    > Hi there,
    >
    > I'm trying to execute a DOS command thru ASP.NET.
    > I tried to use Console.Write("myCommand") but doesn't seem to
    > work. Does
    > anybody knows how can I do it?
    > Well if you're willing to help me a little more, I need to
    > start/stop a
    > service from ASP.NET Application_Start and Application_End Events (in
    > Global.asax).
    > I'm havins "Access Denied" exceptions all the time here. Already
    > set the
    > Service User with the User in IIS, gave Admin Rights to a determined
    > user
    > and tried to place this guy in both places (IIS and Service LogOn
    > User)... none worked.
    >
    > Thanks in advance.
    >
    > Daniel Portal
    >
     
    Brock Allen, Nov 18, 2005
    #2
    1. Advertising

  3. Actually I think you should use
    System.ServiceProcess.ServiceController.GerServices() to retrieve the
    ServiceController object,
    then start/stop it.

    "Daniel Portal" <> ¼¶¼g©ó¶l¥ó·s»D:%23vI4$...
    > Hi there,
    >
    > I'm trying to execute a DOS command thru ASP.NET.
    > I tried to use Console.Write("myCommand") but doesn't seem to work.
    > Does anybody knows how can I do it?
    >
    > Well if you're willing to help me a little more, I need to start/stop a
    > service from ASP.NET Application_Start and Application_End Events (in
    > Global.asax).
    > I'm havins "Access Denied" exceptions all the time here. Already set
    > the Service User with the User in IIS, gave Admin Rights to a determined
    > user and tried to place this guy in both places (IIS and Service LogOn
    > User)... none worked.
    >
    > Thanks in advance.
    >
    > Daniel Portal
    >
     
    Lau Lei Cheong, Nov 19, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DB
    Replies:
    2
    Views:
    1,422
    Eliyahu Goldin
    Jun 22, 2005
  2. Ben Fairbank
    Replies:
    2
    Views:
    5,460
  3. john san
    Replies:
    19
    Views:
    743
    Diez B. Roggisch
    Feb 18, 2005
  4. tomhr
    Replies:
    27
    Views:
    1,419
    Mike Wahler
    Jan 12, 2006
  5. Anonymous
    Replies:
    0
    Views:
    194
    Anonymous
    Apr 3, 2008
Loading...

Share This Page