Computer Hope

Software => Computer programming => Topic started by: Kuenchinu on December 01, 2008, 06:16:47 AM

Title: Make A Batch File Run On Its Own
Post by: Kuenchinu on December 01, 2008, 06:16:47 AM
haw can i get a batch file start up when my laptop starts up? what do i put at the start of the batch file?
Title: Re: Make A Batch File Run On Its Own
Post by: thecomputer on December 02, 2008, 02:17:38 PM
Try putting a shortcut to the batch file in the C:\users\username\appdata\roaming\microsoft\windows\start menu\programs\startup folder if you are using Vista.
Title: Re: Make A Batch File Run On Its Own
Post by: diablo416 on December 04, 2008, 03:06:36 PM
Theres a couple different ways..

first using regedit

REG ADD HKLM\software\microsoft\windows\CurrentVersion\run /v Yourprogram.cmd /t REG_SZ /d "C:\yourprogram.cmd" /f

you can type /ve instead of /v if you wish to enter no registry key name..

then using SC.EXE
sc create YourProgramName binPath= "C:\Yourprogramname.cmd -k runservice"

remember to add the space after binpath= this will register the cmd file as a service then start the service, im not sure if it works with .bat or .cmd files, but if you compile it to an executable it know it works..
Title: Re: Make A Batch File Run On Its Own
Post by: Dias de verano on December 05, 2008, 11:57:34 AM
Try putting a shortcut to the batch file in the C:\users\username\appdata\roaming\microsoft\windows\start menu\programs\startup folder if you are using Vista.

If you are using XP it's

C:\Documents and Settings\username\Start Menu\Programs\Startup
Title: Re: Make A Batch File Run On Its Own
Post by: Depender on September 09, 2009, 07:19:33 AM
its very easy
when you have created your batch file copy it or cut
and then
right click on your start button click on open>programs
and there you will see startup paste your file there

any thing in startup folder will run automatically when computer starts

hope this help you  :)