Batch/CMD: Adding files to Startup list

前端 未结 3 597
北恋
北恋 2021-01-03 00:18

How can a batch file lists itself in the startup list of Windows???

It doesn\'t matter if it goes from the registry or not.

IF with the registry, please give

3条回答
  •  独厮守ぢ
    2021-01-03 00:57

    Not sure i understand you, but if what you want is an easy way to execute a command/batch on startup, why not just put it in the All Users\Startup folder?
    To do so programatically would just mean copying a file to that directory.
    For example, in Windows Vista, the full path of that directory is:

    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
    

    (you can use replace the beginning of the line with %ProgramData% or %AllUsers%\ProgramData to make it more global - such as when Windows is installed on D:).

提交回复
热议问题