Add delay to desktop shortcut

7,754

Solution 1

You can route it through a batch that will "sleep" for the amount of time you want and then run it.

Batch - Option one

Batch - Option two

Solution 2

OK, so I did further research and I found the answer to my own question:

In the shortcut Properties -> Shortcut -> Target field, I typed this

C:\Windows\System32\cmd.exe /c C:\Windows\System32\timeout.exe /T 3 /nobreak > nul && "C:\Program Files\MyProgram\Program.exe" argument /flag
  • The /c flag is to close the cmd window after the program has ran.
  • The /T flag is to specify the timeout (3 in this case).
  • The /nobreak flag is to prevent that keybord input will cancel the wait.
  • The > nul is so that nothing shows up on the cmd window while waiting.

It is basically using batch commands, but compressing it all into one line referenced in the shortcut. Run the script as minimized to avoid the black cmd window show while waiting.

Share:
7,754

Related videos on Youtube

tor
Author by

tor

Student in Computer Science.

Updated on September 18, 2022

Comments

  • tor
    tor over 1 year

    Is there any lightweight way I can add a delay to a desktop shortcut (Windows 7), so that when I click on it, the application will not open until the specified delay has passed?

    • Dave
      Dave over 10 years
      Are you able to explain why?
    • tor
      tor over 10 years
      Not really. Curiosity?
    • Dave
      Dave over 10 years
      Not a real question, it's unlikely to help any one now or in the future.
    • tor
      tor over 10 years
      A more correct answer is that I do not want to disclose my reasons or overall goals in this case. It is not for pranks, though.
    • Admin
      Admin over 10 years
      I'm interested in a way to accomplish this as well, if that's worth anything.
  • tor
    tor over 10 years
    Is it possible to incorporate this directly in the shortcut properties, in the Target field?