Results 1 to 7 of 7

Thread: Scheduled tasks

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    232

    Scheduled tasks

    Is there a setting in scheduled tasks that can say dont run if process is still running?

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Scheduled tasks

    I would schedule a batch file that first calls an exe to check the process,
    If the process is not running, call the task from the exe. If it isn't, just exit it.

    I don't think you can do it any better way with the task scheduler.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    232

    Re: Scheduled tasks

    By the way the task is a vbscript.
    That sounds like a good idea,
    How do i check if a vbscript is running from another vbscript?
    Thanks.

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Scheduled tasks

    Have one script write a byte or two to a file, and delete it when it's done.
    The other script could check for that file every few seconds if need be.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    232

    Re: Scheduled tasks

    Do you know how to call a vbscript from within another VBScript??
    Thanks,

  6. #6
    Lively Member
    Join Date
    May 2005
    Posts
    90

    Re: Scheduled tasks

    I haven't used VBS in a while, but you can try the Shell(file_full_location as string) function. I think it works fine for non-EXE files, but I can't test at the moment. Good luck!
    ^_^

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Scheduled tasks

    You need to call cmd first, like this:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Shell ("C:\Windows\System32\cmd.exe /c  d:\scripts\timezone.vbs "), vbNormalFocus
    5. End Sub

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