How do I delay the start of a program?


  1. Posts : 5
    Windows 10
       #1

    How do I delay the start of a program?


    Once I double click on a particular program I need to delay the start of it by 4 seconds. How can I go about doing this in Windows 10?
      My Computer


  2. Posts : 45,801
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    The easiest way would be to have the shortcut point to a simple script that
    a. provides the required delay
    b. then launches the program

    Easy with Autohohotkey (free) for example.
    Could be done with a bat file or Powershell, but you also need to make sure no window pops up.
      My Computers


  3. Posts : 17,099
    Windows 10 Home x64 Version 22H2 Build 19045.5371
       #3

    Hootis56 said:
    Once I double click on a particular program I need to delay the start of it by 4 seconds.
    Why?

    I agree with dalchina but there's always the risk of misunderstandings if the reason for something is not known.


    Denis
      My Computer


  4. Posts : 1,041
    Windows 7
       #4

    This VBS script will run your program after a specified time delay. If you want to add extra command line arguments, the script will pass them along. The last argument (if numeric) is assumed to be the delay in seconds.

    Script requires a minimum of two arguments (program & delay). Use the full path if it's not a normal Windows command, and put quotes around any pathnames with spaces.

    From command line:
    Code:
    C:\Users\GARLIN\Downloads\DelayStart.vbs notepad 4
    
    C:\Users\GARLIN\Downloads\DelayStart.vbs notepad "C:\Users\GARLIN\Documents\file.txt" 4

    From shortcut:
    Properties -> Target
    Code:
    C:\Users\GARLIN\Downloads\DelayStart.vbs C:\path\app.exe 4
    If the shortcut's icon changes to a VBScript icon, you can "Change Icon" back to the original app.

    The script takes about a second to run, so you might want to shorten the delay.
    How do I delay the start of a program? Attached Files
      My Computer


  5. Posts : 5
    Windows 10
    Thread Starter
       #5

    I have a piece of software that performs tests and after each item is tested the program must be closed and reopened in order to test the next. If it is opened too soon (which often happens) the program gets stuck and you have to close it using task manager. A delay would solve any user error. Yes I know the proper way would be to fix the program, but that’s not my department.

    - - - Updated - - -

    Thanks Garlin , but where’s the delay start.vbs script?
      My Computer


  6. Posts : 17,099
    Windows 10 Home x64 Version 22H2 Build 19045.5371
       #6

    Garlin's script is at the bottom of his post. Just click on it to download it.
    How do I delay the start of a program?-garlin-script.png
    Then right-click on it, choose properties and unblock it.

    Denis
      My Computer


  7. Posts : 5
    Windows 10
    Thread Starter
       #7

    okay thanks, I guess it doesn’t appear for me on mobile. I’ll check it out tomorrow on my pc. Thanks!
      My Computer


  8. Posts : 17,099
    Windows 10 Home x64 Version 22H2 Build 19045.5371
       #8

    Hootis56 said:
    okay thanks, I guess it doesn’t appear for me on mobile. I’ll check it out tomorrow on my pc. Thanks!
    On my Android phone using Firefox, the blue link of the download only appears if I select the Firefox option to use the desktop site.
    I couldn't see any method for seeing the link in Firefox on the mobile version of the forum's webpage.
    My phone's Samsung internet browser showed the link straight-away [perhaps I have it set to always use desktop versions of websites]. It's quite a good browser and is available free from the store for all phones not just Samsungs.


    Denis
      My Computer


  9. Posts : 5
    Windows 10
    Thread Starter
       #9

    garlin said:
    This VBS script will run your program after a specified time delay. If you want to add extra command line arguments, the script will pass them along. The last argument (if numeric) is assumed to be the delay in seconds.

    Script requires a minimum of two arguments (program & delay). Use the full path if it's not a normal Windows command, and put quotes around any pathnames with spaces.

    From command line:
    Code:
    C:\Users\GARLIN\Downloads\DelayStart.vbs notepad 4
    
    C:\Users\GARLIN\Downloads\DelayStart.vbs notepad "C:\Users\GARLIN\Documents\file.txt" 4

    From shortcut:
    Properties -> Target
    Code:
    C:\Users\GARLIN\Downloads\DelayStart.vbs C:\path\app.exe 4
    If the shortcut's icon changes to a VBScript icon, you can "Change Icon" back to the original app.

    The script takes about a second to run, so you might want to shorten the delay.
    Where exactly do I place the arguments you listed for command line and shortcut? Sorry I haven't had to create a script for Windows in a while.
      My Computer


  10. Posts : 1,041
    Windows 7
       #10

    1. You make a desktop shortcut of any app.
    2. Edit properties for that shortcut. Look at Target.
    3. Paste the name of the VBS script (wherever you saved it) before the app. Put the delay in seconds at the end.
    [script] [app] [delay]
    4. If the shortcut changes the icon to a "document scroll" icon, then use Change Icon to pick the app's filename as the new icon image.

    There's no need to create/modify the script, it handles everything. The whole point is to update the shortcut's Target line which is the command that the shortcut runs.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:53.
Find Us




Windows 10 Forums