Search code examples
batch-filecmdautostart

how do i autostart batch file on windows startup


I would like my batch script to start automatically when my victim starts their computer. But it does not work when I put the file under "Start Menu". So how do I do?


Solution

  • Put the batch script (or a .lnk shortcut to it) under (for a specific user)

    %AppData%\Microsoft\Windows\Start Menu\Programs\Startup
    

    or (for all users, putting it here may require Admin privilege)

    %ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup
    

    Or you can edit the registry to add an item or use Windows Task Scheduler. These two methods allow you to put your batch script anywhere.

    FYI, I used to deploy my script1 by putting it somewhere and adding an entry (the type should be REG_SZ) under this registry key:

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    

    (replace HKLM with HKCU to add an item for a specific user instead of all users)

    1: Link goes to my GitHub repo