Need a batch file that can add and remove a .exe file from the start-up. Does any one know ho I could do it. When I say start-up I mean the exe executes when The user log's on. I am compileing the batch file with http://www.battoexeconverter.com/.
You are trying to control the list of applications that are started when a user logs on. The keys that determine that are:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Use the former to control applications started when any user logs on. Use the latter to control applications started when the current user logs on.
You want to do this in a batch file. So you need to use the standard tools for controlling registry keys. That means the reg
tool.
So, add a value like this:
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v MyApp /d myapp.exe
And remove the value like this:
reg delete HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v MyApp
If you want to use HKCU
rather than HKLM
then change the key appropriately. Obviously if you choose to use HKLM
that will require elevation.
Do be prepared for the fact that many virus scanners will treat such activity as evidence that your program is malicious.
If it's simpy an EXE, then copy it to the autostart-folder (or delete it from there):
C:\Users\thatsMe\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\
The name of this folder could change with different Windows-versons or localisations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With