Program starts when windows starts

Start application at when windows Starts

I have checked some other examples.

I am working on a winfrom. & now i am going to create its installer.

i want to start the software when windows starts & trying to use the following code.

But i am confused that where to put this code. i don’t want this code executed every time when my application starts as it will executed once when the software is installed.

shall i put check on form_Load() if the regkey is absent, & if yes then add this value to the Run.

is it correct ? i don’t want to give an option to the user & i want to start this application at the startup compulsorily.

5 Answers 5

You can create your customAction class for your installer like this: http://msdn.microsoft.com/en-us/library/d9k65z2d.aspx#Y0

Once you have this class, put your registry code in the commit section. Now, whenever your application will be installed, your application will be added to registry to run at startup.

As the others users have commented, this kind of thing should go on the installer. On the setup project you can create with Visual Studio, you can add a link to the user’s startup folder that should do the trick.

BUT

If you don’t want the user tampering with the startup folder and you absolutely want the program to start automagically with Windows, you could do as you’ve said: check for the adequate registry key everytime the program starts, and if it’s not there write it. Take into account your program will need elevated account rights for this.

BUT

Do you ABSOLUTELY need this? Are you absolutely sure you can’t offer it as an option to the final user? If I was a user to your program, didn’t want it on startup, take the effort to remove a registry key to get it out of there and then find out it’s again in the registry without my consent, I’d be pretty pissed.

How do I set a program to launch at startup

I have a small application with a CheckBox option that the user can set if they want the app to start with Windows.

My question is how do I actually set the app to run at startup.

ps: I’m using C# with .NET 2.0.

11 Answers 11

Several options, in order of preference:

  1. Add it to the current user’s Startup folder. This requires the least permissions for your app to run, and gives the user the most control and feedback of what’s going on. The down-side is it’s a little more difficult determining whether to show the checkbox already checked next time they view that screen in your program.
  2. Add it to the HKey_Current_User\Software\Microsoft\Windows\CurrentVersion\Run registry key. The only problem here is it requires write access to the registry, which isn’t always available.
  3. Create a Scheduled Task that triggers on User Login
  4. Add it to the HKey_Local_Machine\Software\Microsoft\Windows\CurrentVersion\Run registry key. The only problem here is it requires write access to the registry, which isn’t always available.
  5. Set it up as a windows service. Only do this if you really mean it, and you know for sure you want to run this program for all users on the computer.

This answer is older now. Since I wrote this, Windows 10 was released, which changes how the Start Menu folders work. including the Startup folder. It’s not yet clear to me how easy it is to just add or remove a file in that folder without also referencing the internal database Windows uses for these locations.

Читайте также:  Альтернативный rdp сервер для windows 10

How can I run a program from a batch file without leaving the console open after the program starts?

For the moment my batch file look like this:

The program starts but the DOS Window remains open. How can I close it?

11 Answers 11

You can use the exit keyword. Here is an example from one of my batch files:

Use the start command to prevent the batch file from waiting for the program. Just remember to put a empty double quote in front of the program you want to run after «Start». For example, if you want to run Visual Studio 2012 from a batch command:

notice the double quote after start.

– Kruug Sep 25 ’13 at 20:37

Look at the START command, you can do this:

For instance, this batch-file will wait until notepad exits:

However, this won’t:

works if you start the program from an existing DOS session.

If not, call a vb script

  • intWindowStyle : 0 means «invisible windows»
  • bWaitOnReturn : false means your first script does not need to wait for your second script to finish

Here is invis.vbs:

This is the only thing that worked for me when I tried to run a java class from a batch file:

start «cmdWindowTitle» /B «javaw» -cp . testprojectpak.MainForm

You can customize the start command as you want for your project, by following the proper syntax:

You should try this. It starts the program with no window. It actually flashes up for a second but goes away fairly quickly.

How to solve «space problem» and local dependencies:

Loads of answers for this question already, but I am posting this to clarify something important, though this might not always be the case:

Might cause issues in some windows versions as Start actually expects the first set of quotation marks to be a windows title. So it is best practice to first double quote a comment, or a blank comment:

My solution to do this from the GUI:

Create a shortcut to the program you want to run;

Edit the shortcut’s properties;

Change the TARGET field to %COMSPEC% /C «START «» «PROGRAMNAME»» ;

Change the RUN field to minimized.

Ready! See how you like it.

PS: Program parameters can be inserted in between the two final quotation marks; the PROGRAMNAME string can be either a filename, a relative or an absolute path — if you put in an absolute path and erase the drive letter and semicolon, then this will work in a thumbdrive no matter what letter the host computer assigns to it. (also, if you place the shortcut in the same folder and precede the program filename in PROGRAMNAME with the %CD% variable, paths will always match; same trick can be used in START IN field).

How to Add Programs to Startup in Windows 10

Launch your favorite apps every time you boot up

What to Know

  • Open the Run dialog box, enter shell:startup, then right-click inside the Startup folder and select New >Shortcut to add a program.
  • If you can’t find the app, enter shell:appsfolder in the Run dialog box, then drag apps from that folder into the Startup folder.
  • Some apps offer a ‘run at startup’ option, which is an easier way to add a program to startup in Windows 10.

This article explains how to add a program to startup in Windows 10. Applications that are designated as startup programs are launched as Windows 10 boots.

How to Add Programs to Startup in Windows 10

You can enable or disable apps from running on startup in the App Startup Control Panel and the taskbar, but the only place you can add new startup programs is through the startup folder.

Some modern apps have a ‘run at startup’ capability built into their options. If your app has that option, then turning it on is a lot easier than the following method, which is designed to work with all programs.

Press the Windows key + R to open the run dialog box.

Type shell:startup in the run dialog box and press Enter on your keyboard.

Right click in the startup folder and click New.

Click Shortcut.

Type the location of the program if you know it, or click Browse to locate the program on your computer.

If you can’t find your app, try opening the run dialog box back up and typing shell:appsfolder. You can drag any app from that folder into the startup folder to instantly create a shortcut.

Click Next.

Type a name for the shortcut, and click Finish.

Create additional links for any other programs you want to run automatically when Windows starts.

Restart your computer, and the new programs will launch automatically.

What Is the Windows Startup Folder?

The Windows startup folder is a folder that Windows looks in for programs to run every time it starts. This was the only way to manage startup programs in older versions of Windows. Adding a program shortcut causes that program to launch when Windows starts, and removing a program shortcut stops it from launching when Windows starts.

Читайте также:  Windows server сбросить кэш dns

While Windows 10 has moved to the newer app startup control panel as the primary way to manage which apps, the startup folder remains the best way for users to add their own startup programs.

Drawbacks to Adding Programs to the Startup Folder in Windows 10

The benefits of adding programs you use every day to the Windows 10 startup folder are obvious. Instead of waiting for Windows to start up and then manually clicking on everything you launch every day, all you have to do is turn your computer on and wait for everything to load.

The issue is that it takes time for programs to load along with Windows, and every program you load takes up resources like memory and processor power. Load too many unnecessary programs, and you’ll find that Windows 10 starts slow and may even remain sluggish after loading everything.

If you change your mind about programs you’ve added to the startup folder, you can simply delete the shortcuts to prevent those programs from launching whenever you turn on your computer. You can also change startup programs in Windows 10 using the task manager or the startup app control panel.

What to Do If You Have Too Many Windows 10 Startup Programs

If you have some essential programs that you use for work every day, or you mainly use your computer to play a specific game, try adding the programs that are important to you and then removing programs you don’t ever use.

Your computer probably came with bloatware you never actually use, and applications are often set to run when Windows starts up even if you don’t want them to. Disable those startup programs, add the ones you want, and you’ll enjoy both convenience and faster startup times.

How to Add an App or Program to Startup in Windows 10: Startup Folder, Registry, Scheduler

Not all programs have such an option in their settings that lets you enable or disable its automatic start when you turn on your PC.

But you may want to add apps and programs to startup in Windows 10 and make them automatically launch when the PC boots up to a user account.

By the way, it’s not only about apps. You can do the same even with a document, URL address or folder if you need.

Here is an ultimate guide on how to find the startup folder for a particular user or for all users and make any program run at startup in Windows 10.

[Quick Navigation]:

Before we start explaining the boring process, it should be mentioned that some programs have a special option in their settings called “load when Windows starts”, “launch when system starts” or something alike.

Thus, all you need to do is go to the program’s setting, enable the auto-start option and that’s all. No shortcuts needed:

Make program run on startup in Windows 10

For programs that don’t have such parameter read the rest of the tutorial on how to find the startup folder and change startup programs in Windows 10.

Note that in the latest versions of Windows 10 all programs that were running at the moment when you shut down or rebooted your computer, automatically start the next time you log in.

This in any case doesn’t mean that those programs are added to Windows 10 startup folder, scheduler, or whatever. This is a standalone feature of Windows 10 which is enabled by default.

Windows 10 Startup Folder Location

If you want to add a program, app, URL or document to startup you should place its shortcut to user startup folder. By default it is located in:

How to Quickly Open the Startup Folder in Windows 10, 8, 7

Method 1

  • Copy this address: %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
  • Press Win+E to open Windows 10 Explorer.
  • Paste it into the address bar:
  • Hit Enter :

Method 2

Another way to open Windows 10 startup folder is to use the Run dialogue:

  • Press Win+R
  • Type
  • Click OK or press Enter :

How To Add Programs To Startup In Windows 10 For The Current User

You may put shortcuts to various items into this directory. But be cautious: adding too many programs to the startup folder can make your PC boot slowly (especially if you are still using a classic hard disk drive as your system disk).

Perform the following steps:
STEP 1. Open the Startup Folder using any method explained above.
STEP 2. Copy a program, app, folder, document, link or anything else:
STEP 3. Paste the shortcut to startup folder:
This is how it should look like:

The same steps in the video guide:

Читайте также:  Как установить windows phone 10 lumia 630

Add a Startup Program For All Users At Once

If you wish to set a program to run on startup for all users accounts, create its shortcut in common startup folder. In Windows 10 its default location is:

You can open it by the path: %ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp or using the Run dialogue as we explain below.

  1. Press Win+R .
  2. Type
  3. Press Enter :
  4. Copy the executive file or document.
  5. Use Paste or Paste shortcut to place one to Common startup folder:

Alternative Method To Create A Shortcut In Windows 10 Startup Folder

  1. Right-click the empty area and select New -> Shortcut :
  2. Browse the file or folder or enter URL and press Next :
  3. Give a name to your new shortcut and press OK :

How to Make Modern Apps Run on Startup in Windows 10

You can also add Modern apps from Microsoft Store to startup folder. Follow the steps:

    1. Open the startup folder: press Win+R , type shell:startup , hit Enter .
    2. Open the Modern apps folder: press Win+R , type shell:appsfolder , press Enter .
    3. Drag the apps you need to launch on startup from the first to the second folder and select Create shortcut:

Now restart your computer and check if your program, app or another item you specified runs correctly as you log in to the user account (or as soon as your PC signs in automatically as we explained here).

How to Disable Startup Apps in Windows 10

As you might know, the more apps are added to startup, the longer you have to wait before you start using your PC.

That’s why users often apply the following steps to disable unnecessary programs from being launched at log in.

Here is how to stop programs from running at startup in Windows 10.

Method 1: Use Settings

  • Press Win+I on your keyboard to launch Windows 10 Settings;
  • Dive into the Apps category:
  • Select Startup in the left pane;
  • Disable apps you don’t want to be launched when you log in to your user account:

Method 2: Use Task Manager

  • Right-click the Taskbar and click Task Manager :
  • Go to the Startup tab;
  • Select the app you wish to disable from auto launching;
  • Click Disable :

Here is the video guide:

Add or Remove Startup Apps / Programs in the Task Scheduler

The simplest way to open the Task Scheduler in Windows 10 is to press “Win+R”, type “taskschd.msc” and hit “Enter”.

Disable startup programs in the Task Scheduler

Here you can look through the list of auto-start items, add new or remove existing. Using the Task Scheduler requires some experience. So, be careful while using it.

If you are not sure what to do with a certain startup item, first opt to “Disable” it and check the result rather than “Delete”.

Use Registry Editor to Manage Windows 10 Startup Apps & Programs

The system registry is yet another way to add or remove auto-start apps in Windows 10. Feel free to use it if this option is more preferable.

Launch the registry editor: press “Win+R”, type “regedit” and hit “Enter”.

Here you will see all programs that start when the current user logs in.

If you didn’t find the app you expected, check another registry key responsible for the common startup (for all users on the current PC):

How to Add Programs to Startup Using the Registry Editor

First, you need to decide either you want to run the program when the current user logs in, or all users on the computer at once. Depending on your decision, navigate to the one of the mentioned above registry keys.

Then, in the right part of the Registry Editor window right-click on the empty area and select New > String value

Give it a name, enter the path to the program you wish to add to Windows 10 startup and click “OK”.

Manage Startup Apps & Programs Using the Autoruns Utility

Sysinternals Autorun is a free utility that you can download from its official website https://docs.microsoft.com/en-us/sysinternals/downloads/autoruns

It doesn’t require the installation – you need just to launch the exe file.

With the help of the Autoruns utility you can:

  • view the list of everything that automatically starts on your PC and remove startup items;
  • use the Jump to Image option to reveal the location of the program;
  • use the Jump to entry option to find out the way how the particular program added to auto-start (startup folder, registry key, scheduler, etc);
  • scan startup items for viruses using VirusTotal in 1 click and see the result in the corresponding field of the program;
  • and much more.

The Conclusion

If you know how to achieve the same result in easier ways, please drop a comment below. We will also be very grateful if you share this article on social networks. Thank you and good luck!

Оцените статью