How run a program at startup?

jokar's Avatar
Newbie Member
Hello all.
i write a program and want change windows registry for rum my program at startup,what should i do?

i wanna my program copied to the windows directory too ,can you show me some code?

Chong's Avatar, Join Date: May 2011
Go4Expert Member
One way to run a program at startup is to try Start->Control Panel->Add Scheduled Task ..
Best regards
kyle's Avatar, Join Date: Dec 2010
Go4Expert Member
if you have already wrote the program or you have the program, it's very simple...
one way is to manually create a shortcut of the program and paste it into the startup folder in Start ==> All Programs ==> Startup and to copy the program to windows directory manually
or you could try this...

@echo off

title Program-Copier

color 0a


set dirvar=windowsdir

set dirvar1=startupdir

if exist "C:\Windows\program-name.extinson". (
set %dirvar%==1
) else (
copy "drive:\program-path\program-name.extinsion" "C:\Windows"
set %dirvar%==1

if exist "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\startup\program-name.extinsion". (
set %dirvar1%==1
) else (
copy "C:\Windows\program-name.extinsion" "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\"
set %dirvar1%==1


if %windowsdir% equ %startupdir% (
msg * "The program was copied successfully to Windows directory and to Startup directory."
) else (
msg * "The program was not copied successfully in Windows directory or Startup directory."
goto :first
before saving this you should change some things
first copy the code to notepad and do the following...

ctrl + h
find what: program-name.extinsion
replace with: your programs name with the extinsion
another replacement
ctrl + h
find what: drive:\program-path
replace with: your programs full location path. example "C:\programs\myprogram-folder\"
Warning The path must end with a backslash "\" and it does not include the program name !

Warning Do not remove any double-quotes or dots just replace the sentences !

save it as program-mover.bat in whatever location you want
remember this works in Windows 7 only for another version just comment to create another one

This would see if your program exists in the windows directory and if it does not it copies it to the windows directory
cheks if it exists in startup folder and if it does not, it copies it to the startup folder.
Alex.Gabriel's Avatar
Seems to me or somebody tryes to make some unwanted executable. Most of the viruses are hidden in the windows folder
kyle's Avatar, Join Date: Dec 2010
Go4Expert Member
yes i know why he needs this but... pfff what the hell, i just thought to give him a hand