Delaying Startup Programs


  1. Posts : 127
    Windows 7 / 64
       #1

    Delaying Startup Programs


    Using various programs such as Glary Utilities Startup Manager, Anvir and others I set certain programs to delay. Not only do they delay...but they don't show up on the taskbar the systray or anywhere else as startup items. To stat them I have to manually go into the Programs file. Not a big deal, but very curious!

    Any Ideas?
      My Computer


  2. Posts : 8,059
    windows 10
       #2

    Winpatrol does it and they start normal or you can create a simple cmd file to load software after x min and run that at start not the software itself
      My Computer


  3. Posts : 127
    Windows 7 / 64
    Thread Starter
       #3

    How is that CMD file work?
      My Computer


  4. Posts : 8,059
    windows 10
       #4

    Simple timout then in mins ie 5

    @echo off
    timeout 5 > NUL
    excel.exe
      My Computer


  5. Posts : 7,606
    Windows 10 Home 20H2
       #5

    VBScript can do the same in the background without a CMD window appearing.

    Code:
    WScript.Sleep 300000
    CreateObject("wscript.shell").run "Notepad.exe"

    Note that "300000" stands for five minutes, as "1000" stands for one second.
    Just put the VBScript into the Startup folder.
      My Computer


  6. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #6

    Hello @orealius,

    The Startup folder[s] mentioned above are located at . . .

    All Users Startup Folder:-
    Code:
    
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

    Current User Startup Folder:-
    Code:
    
    C:\Users\Your_User_Name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    You can just Copy & Paste the above Commands into the Explorer Bar and then press Enter. This will take you DIRECTLY to the folder.

    I hope this helps.
      My Computer


  7. Posts : 5,443
    Windows 11 Home
       #7

    You can use task scheduler, but each software uses unique command switches, so if you want them to be used, you have to find out, what they are, usually but setting a normal startup and copying it. For example:
    Code:
    Discord.exe --start-minimized
    ProcessHacker.exe -hide
    steam.exe -silent
      My Computer


  8. Posts : 1,203
    11 Home
       #8

    TairikuOkami said:
    You can use task scheduler, but each software uses unique command switches, so if you want them to be used, you have to find out, what they are, usually but setting a normal startup and copying it. For example:
    Code:
    Discord.exe --start-minimized
    ProcessHacker.exe -hide
    steam.exe -silent
    Yes, this is definitely one of the best methods to set up a delayed start for programs/scripts especially if the wait duration has to be longer than just a few seconds. I found out some time ago that using WScript.Sleep in VBScript actually causes a fairly big load on the CPU, so I try to avoid it now. This is also related to the fact that VBScript can't support the Application.DoEvents() method that normal VB can. The TIMEOUT command in a batchfile is much more similar to setting a delay with Task Scheduler in this regard, but running a batchfile causes the command window to remain visible until the command exits, so I always run the batchfile from a separate VBScript by using the Run method with the second parameter 0.
    Code:
    Set wshShell = CreateObject("WScript.Shell")
    wshShell.Run "<filepath of the batchfile>", 0
    Set wshShell = Nothing
    (Substitute <filepath of the batchfile> with the filepath of the batchfile.)

    Task Scheduler can only support a duration of either 15 seconds or an integer multiple of one minute, which isn't necessarily always a problem of course. It depends on what you want to achieve. If, for example, you have denied access to both WScript and CScript for security reasons and you really don't want to see a command window, Task Scheduler can be a great alternative choice. One thing to be aware of when creating a task in Task Scheduler for this purpose is that a program that has to keep running uninterruptedly until Windows either is shut down or is restarted will be terminated after 3 days by default if you forgot to untick the "Stop task if it runs longer than:" checkbox, which matters for example if you prefer to put your computer to sleep instead of always shutting it down. Laptop users also need to remember to untick the "Start the task only if the computer is on AC power" checkbox.

    Task Scheduler can also conveniently be used to wait for an Event, such as the creation of a specific process. For that to work, you need to enable auditing, in such a way that each Process Creation event will be written to the Security eventlog, like so:
    auditpol /set /subcategory:{0cce922b-69ae-11d9-bed3-505054503030} /success:enable
    You could decide to put this command in the Action of an additional new task that you can create in Task Scheduler, such a way that this task is run with Administrator privileges (check the "Run with highest privileges" checkbox for this), when a user logs on or when Windows starts. Next, if you want auditing for Process Creation to be automatically disabled again the moment when your task is run, you can create another additional new task, in which you have substituted "enable" with "disable". So when the Process Creation event that you want to wait for is fired, a third task will be triggered, and, as part of the Actions tab, the aforementioned task will be run, to disable the auditing. (Put %windir%\System32\schtasks.exe in "Program/script:", /run /tn "<name of the task>" in "Add parameters (optional):" and substituting <name of the task> with the name of the task that will disable the auditing.)
    As part of this same Actions tab also, you can then specify the commands that you want to be run after the Process Creation event. Finally, on the Triggers tab you can specify a Custom Event Filter. There is a button that, when clicked, will display a warning dialog. Choose to continue and you will be able to edit the XML content so in there it allows you to customize the filter. An example:
    Code:
    <QueryList>
      <Query Id="0" Path="Security">
        <Select Path="Security">*[System[band(Keywords,9007199254740992) and (EventID=4688)]] and *[EventData[Data[@Name='NewProcessName'] and (Data='C:\Windows\explorer.exe')]] and *[EventData[Data[@Name='ParentProcessName'] and (Data='C:\Windows\System32\rundll32.exe')]]</Select>
      </Query>
    </QueryList>
    So as soon as your rundll32.exe process creates an explorer.exe process, your task will be run. Of course this is just an example, so you still need to go in Event Viewer (eventvwr.msc) and navigate to the Security eventlog to figure out what process gets created by what other process and when, or under what circumstances. That is, at least if you want to make use of this type of tinkering, if you aren't afraid to experiment and you can spend the time and effort to run a few tests.
      My Computers


  9. Posts : 7,606
    Windows 10 Home 20H2
       #9

    hdmi said:
    I found out some time ago that using WScript.Sleep in VBScript actually causes a fairly big load on the CPU
    It uses "0% CPU" at my end. See below:

    Delaying Startup Programs-0-cpu-usage.jpg
      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 20:53.
Find Us




Windows 10 Forums