Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Jan 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Interesting - schtasks cammand in ASP.NET (ASP.Net)

    Hello,

    I am trying to use the wScript object in my ASP.NET page to trigger a scheduled task on a server on the network. I am able to accomplish this locally however, when I publish the page onto the web server I get nothing. Here's what I have so far...

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim wshell As Object
    wshell = CreateObject("WScript.Shell")

    wshell.run("cmd /c schtasks.exe /run /s server2 /tn AM")

    wshell = Nothing

    End Sub

    When a user clicks on this button the command schtasks.exe is executed on the web server which triggers the scheduled task on server2. Again, it works fine locally, but when I publish it on the webserver the only thing I see happening on the web server is in the taskmanager the process schtasks.exe is running, but the command is not passing through to server2. I know the cammand works because when I open a command window on the web server and type it in, I can see the execution on server2.

    Please help.

    Regards.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Interesting - schtasks cammand in ASP.NET (ASP.Net)

    You already posted the same question in <post:=653,775>post 653,775</post:>. Please don't double-post.

    This thread is locked to prevent confusion and duplication. Please post all replies in the other thread.

Posting Permissions

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