Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    7

    Unanswered: using jt.exe with asp

    I am trying to create an asp page the will use the jt.exe to create a scheuduled task from within an asp page.

    I can not get the darn thing to work. Here is what I am trying to do:

    jtexe= "jt.exe"
    shellcmd=jtexe
    shellcmd = shellcmd+ " /CTJ StartDate=" & date()
    shellcmd = shellcmd+ " StartTime=" & time()
    shellcmd = shellcmd+ " HasEndDate=0"
    shellcmd = shellcmd+ " KillAtDuration=0"
    shellcmd = shellcmd+ " Disabled=0"
    shellcmd = shellcmd+ " Type=daily"
    shellcmd = shellcmd+ " /SC kwimgore Uqbn#A#CXC"
    shellcmd = shellcmd+ " /SJ ApplicationName=test"
    shellcmd = shellcmd+ " WorkingDirectory=c:/"
    shellcmd = shellcmd+ " Creator=kwigmore"
    shellcmd = shellcmd+ " Priority=Normal"
    shellcmd = shellcmd+ " MaxRunTime=3600000"
    shellcmd = shellcmd+ " DontStartIfOnBatteries=0"
    shellcmd = shellcmd+ " KillIfGoingOnBatteries=0"
    shellcmd = shellcmd+ " RunOnlyIfLoggedOn=0"
    shellcmd = shellcmd+ " SystemRequired=0"
    shellcmd = shellcmd+ " DeleteWhenDone=1"
    shellcmd = shellcmd+ " Suspend=0"
    shellcmd = shellcmd+ " StartOnlyIfIdle=0"
    shellcmd = shellcmd+ " KillOnIdleEnd=0"
    shellcmd = shellcmd+ " RestartOnIdleResume=0"
    shellcmd = shellcmd+ " Hidden=0"
    shellcmd = shellcmd+ " TaskFlags=0"
    shellcmd = shellcmd+ " /SM \\saturn"
    shellcmd = shellcmd+ " /SAJ test"
    shellcmd = shellcmd+ " /SAC test"

    shell "%COMSPEC% /e:1024 /c " & shellcmd


    Can some one please let me know what I am doing wrong.

    Thanks
    Kim

  2. #2
    Join Date
    Jun 2004
    Posts
    1
    jtexe= "jt.exe"
    shellcmd=jtexe
    shellcmd = shellcmd & " /CTJ StartDate=" & formatdatetime(date(),2)
    shellcmd = shellcmd & " StartTime=" & formatdatetime(time(),4)
    shellcmd = shellcmd & " HasEndDate=0"
    shellcmd = shellcmd & " KillAtDuration=0"
    shellcmd = shellcmd & " Disabled=0"
    shellcmd = shellcmd & " Type=daily"
    shellcmd = shellcmd & " /SC kwimgore Uqbn#A#CXC"
    shellcmd = shellcmd & " /SJ ApplicationName=test"
    shellcmd = shellcmd & " WorkingDirectory=c:\"
    shellcmd = shellcmd & " Creator=kwigmore"
    shellcmd = shellcmd & " Priority=Normal"
    shellcmd = shellcmd & " MaxRunTime=3600000"
    shellcmd = shellcmd & " DontStartIfOnBatteries=0"
    shellcmd = shellcmd & " KillIfGoingOnBatteries=0"
    shellcmd = shellcmd & " RunOnlyIfLoggedOn=0"
    shellcmd = shellcmd & " SystemRequired=0"
    shellcmd = shellcmd & " DeleteWhenDone=1"
    shellcmd = shellcmd & " Suspend=0"
    shellcmd = shellcmd & " StartOnlyIfIdle=0"
    shellcmd = shellcmd & " KillOnIdleEnd=0"
    shellcmd = shellcmd & " RestartOnIdleResume=0"
    shellcmd = shellcmd & " Hidden=0"
    shellcmd = shellcmd & " TaskFlags=0"
    shellcmd = shellcmd & " /SM \\saturn"
    shellcmd = shellcmd & " /SAJ test"
    shellcmd = shellcmd & " /SAC test"

    vbscript (asp) need '&' instead of '+'
    we hope that this will help you

  3. #3
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    And there is no "shell" command in ASP... you need to do:

    Code:
    Dim objShell
    Set objShell = Server.CreateObject("WScript.Shell")
    objShell.Exec(shellcmd)
    Set objShell = Nothing
    That which does not kill me postpones the inevitable.

Posting Permissions

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