- Application. Run Метод
- Определение
- Перегрузки
- Возвращаемое значение
- Исключения
- Примеры
- Комментарии
- How to Add an App or Program to Startup in Windows 10: Startup Folder, Registry, Scheduler
- Windows 10 Startup Folder Location
- How to Quickly Open the Startup Folder in Windows 10, 8, 7
- Method 1
- Method 2
- How To Add Programs To Startup In Windows 10 For The Current User
- Add a Startup Program For All Users At Once
- Alternative Method To Create A Shortcut In Windows 10 Startup Folder
- How to Make Modern Apps Run on Startup in Windows 10
- How to Disable Startup Apps in Windows 10
- Method 1: Use Settings
- Method 2: Use Task Manager
- Add or Remove Startup Apps / Programs in the Task Scheduler
- Use Registry Editor to Manage Windows 10 Startup Apps & Programs
- How to Add Programs to Startup Using the Registry Editor
- Manage Startup Apps & Programs Using the Autoruns Utility
- The Conclusion
- Starting Windows 10 «Store App» from the command line.
Application. Run Метод
Определение
Запускает приложение Windows Presentation Foundation. Starts a Windows Presentation Foundation application.
Перегрузки
Запускает приложение Windows Presentation Foundation. Starts a Windows Presentation Foundation application.
Запускает приложение Windows Presentation Foundation с открытием указанного окна. Starts a Windows Presentation Foundation application and opens the specified window.
Запускает приложение Windows Presentation Foundation. Starts a Windows Presentation Foundation application.
Возвращаемое значение
Код выхода Int32, возвращаемый приложением в операционную систему при завершении работы приложения. The Int32 application exit code that is returned to the operating system when the application shuts down. По умолчанию, код выхода равен 0. By default, the exit code value is 0.
Исключения
Run() вызывается из приложения, размещенного в браузере (например, приложения браузера XAML (XBAP)). Run() is called from a browser-hosted application (for example, an XAML browser application (XBAP)).
Примеры
В следующем примере показано приложение, которое использует пользовательский объект Application и поэтому должен явно вызывать метод Run . The following example shows an application that uses a custom Application and must therefore explicitly call Run.
Комментарии
Run вызывается для запуска приложения WPF. Run is called to start a WPF application. При определении Application с помощью разметки или разметки и кода программной части Run будет вызываться неявно. If you define your Application using markup, or markup and code-behind, Run will be called implicitly. Однако при определении Application с помощью кода необходимо явно вызвать метод Run . However, if you define your Application using code, you will need to explicitly call Run.
При Run вызове метода Application присоединяет новый Dispatcher экземпляр к потоку пользовательского интерфейса. When Run is called, Application attaches a new Dispatcher instance to the UI thread. Затем Dispatcher Run вызывается метод объекта, который запускает конвейер сообщений для обработки сообщений Windows. Next, the Dispatcher object’s Run method is called, which starts a message pump to process windows messages. Наконец, Dispatcher объект вызывает Application OnStartup метод объекта для вызова Startup события. Finally, the Dispatcher object calls the Application object’s the OnStartup method to raise the Startup event. Следовательно, модель выполнения приложения была установлена на время обработки Startup , после чего приложение считается запущенным. Consequently, the application execution model has been established by the time you handle Startup, at which point the application is considered to be running.
Приложение прекращает выполнение при Shutdown вызове; значение ShutdownMode свойства определяет Shutdown , когда вызывается, и происходит ли его автоматическое или необходимо явно вызывать. An application stops running when Shutdown is called; the value of the ShutdownMode property determines when Shutdown is called, and whether it happens automatically or you need to explicitly call it.
Run может вызываться только из потока, который создает Application объект. Run can be called only from the thread that creates the Application object. Кроме того, Run нельзя вызывать из XBAP. Also, Run cannot be called from a XBAP.
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:
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.
- Press Win+R .
- Type
- Press Enter :
- Copy the executive file or document.
- Use Paste or Paste shortcut to place one to Common startup folder:
Alternative Method To Create A Shortcut In Windows 10 Startup Folder
- Right-click the empty area and select New -> Shortcut :
- Browse the file or folder or enter URL and press Next :
- 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:
-
- Open the startup folder: press Win+R , type shell:startup , hit Enter .
- Open the Modern apps folder: press Win+R , type shell:appsfolder , press Enter .
- 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!
Starting Windows 10 «Store App» from the command line.
How do you start a the «new and improved» Metro / Universal / Store (cr)App from the command line?
The original question was, when I’m running a 3rd party photo editor application, I have the option of starting other photo editor applications from inside it (because they have different editing features), so I need to provide a «command line» to start the Windows Store Photo application.
Store Apps are MS’s «latest and greatest» take on application programming, primarily run from the Windows 10 start menu. So they MUST be easy to start. Not so much. They are designed to be started from the start menu only. Even with a shortcut on the desktop you DO NOT have enough information to create the required command line.
So, tighten your seatbelts and take your anti-nausea pills, here it comes the rollercoaster ride of fun .
(FYI: I had an issue running the Photos app, so I had to test with Weather instead)
- Open run dialog
- Type:
shell:AppsFolder - Find your app (Photos) in the folder
- Right click and choose «Create Shortcut»
- Say «Yes», to prompt to «place the shortcut on desktop»
- Right click the shortcut and choose «Properties»
- Make sure Shortcut tab is displayed
- Make note of the entry in the “Target” field (ie Microsoft.BingWeather_ 8wekyb3d8bbwe)
get-appxpackage > 123.txt