The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Q&A: How do I Launch a Service after AlwaysUp Starts my Application?

How do I Launch a Service after AlwaysUp Starts Google Drive
   I’m interested in purchasing your AlwaysUp application but would like some further information first if you don’t mind.

My main goal is to run Google Drive for desktop as a service. But there is an existing Windows Service that I need to run after Google Drive has launched. Is it possible to use AlwaysUp to start it after Google Drive has started?

— Shaheed

Hi Shaheed, thanks for trying AlwaysUp.

The answer to your question is yes. Please follow these steps to setup Google Drive and your other service in AlwaysUp.

1. Install Google Drive as a service with AlwaysUp

As described in our step-by-step tutorial, the new AlwaysUp Application Advisor supports Google Drive for desktop:

Application Advisor supports Google Drive for desktop

Instead of leaving you to figure out and apply the best settings to support background file synchronization, simply click through the Advisor’s straightforward prompts to create your Google Drive service — in less than 2 minutes.

At the end of the process, your Google Drive for desktop will be installed as a 24/7 Windows Service. Afterwards, test and make sure that the new service syncs your files as expected.

2. Have AlwaysUp start the other service after it runs Google Drive

Now that Google Drive is set up, let’s turn our attention to starting the other service at the right time.

Please:

  1. Edit your Google Drive for desktop entry in AlwaysUp.

  2. Move to the Automate tab.

  3. Check the When the application starts… box at the top.

  4. Enter the following command (which will start your service):

    C:\Windows\System32\net.exe START "<Service-Name>"

    where <Service-Name> is the name of your service. Note that the quotes around the name are required if it contains a space.

  5. In the Every section, specify when the service should be started.

  6. Check the Only option and set the value to 1 (because we only need to start the service once).

  7. Finally, save your settings.

For example, if you want to start the Print Spooler service (named “Spooler”) 30 seconds after Google Drive starts, your Automate tab should look like this:

Use AlwaysUp to automate NET START

3. Change your service to start manually

Is Windows starting your service when the computer boots? If so, you may want to change that because with step 2 in place, AlwaysUp will start the service when it’s needed.

To prevent Windows from starting your service at boot:

  1. Start the Services application (run “services.msc” to launch it)

  2. Scroll the list to find your service.

  3. Double-click the entry to bring up the service’s properties.

  4. In the Startup type field, select Manual. It should look like this:

    Set the service's startup type to Manual
  5. Save your changes.

And that’s it!

Next time your computer boots:

  1. Windows will automatically start AlwaysUp

  2. AlwaysUp will start Google Drive

  3. And after a few seconds/minutes (whichever you specified), AlwaysUp will start your service.

All the best.

Posted in AlwaysUp | Tagged , , , , | Leave a comment

Q&A: Can AlwaysUp Auto-Start and Recycle my Leaky Program Once per Day?

Can AlwaysUp Restart my Leaky Program Once per Day?
  I am trying out AlwaysUp and so far I like the way it works.

I’m running this program as a service is for only two reasons: to start when the computer boots and (the most important one) to be able to schedule it to stop and restart once a day at the time of my choosing. I need to do this or the program will run out of memory over time and cause all kinds of trouble when I am away from my computer for more than 24 hours.

Is AlwaysUp capable of doing this?

— Ron

Hi Ron.

Yes, AlwaysUp can do both of the things you would like to do.

AlwaysUp will start your program at boot

The first task — starting your program when your computer boots — was the main reason for building AlwaysUp. Rest assured that AlwaysUp will do everything in its power to ensure that your program starts quickly after a power cycle or any other event that causes your PC to reboot.

Note that AlwaysUp provides a couple of options for when to launch your application:

  1. Automatically, when the computer boots: Starts your application as quickly as possible, usually seconds after boot

  2. Automatically, but shortly after the computer boots: Runs your application about 2 minutes after boot, after critical operating system services (e.g. networking, security) have started.

Make your selection on the General tab when configuring your application:

Options to start your application as a service

AlwaysUp will restart/recycle your program daily

The second task — recycling your application daily to keep it “fresh” — is easily done too.

In fact, recycling an application is one of AlwaysUp’s most popular features! It comes in handy for programs that get sicker over time, like yours does.

To illustrate, here are the steps to stop and restart your application at 3 AM every morning:

  1. Edit your application in AlwaysUp.

  2. Switch to the Monitor tab. The settings on this screen specify when AlwaysUp should intervene and stop your application.

  3. Since we want to stop at a specific time, check the Every box, choose Day from the drop-down and enter 3:00 AM in the time field:

    Stop your application daily at 3 AM
  4. Switch to the Restart tab.

  5. Ensure that the When your application stops, restart it box at the top is checked. If not, AlwaysUp won’t restart your application after it stops it at 3 AM.

    By default, AlwaysUp will restart your program immediately but you can specify another schedule if you like:

    Restart your application after it stops
  6. Save your changes.

Putting it all together…

With the recommendations above in place, when your computer boots:

  1. Windows will start AlwaysUp

  2. AlwaysUp will start your application

  3. AlwaysUp will watch your application and quickly restart it if it stops for any reason

And whenever 3 AM rolls around, AlwaysUp will:

  1. Stop your application

  2. Restart your application — so fresh, so clean.

That addresses all your concerns, right? Please let us know if not.

Best of luck with your program!

Posted in AlwaysUp | Tagged , , , | Leave a comment

ChatGPT Knows Windows Services

ChatGPT Knows Windows Services

Like many folks this holiday season, we’ve been playing with OpenAI’s ChatGPT — the surprisingly conversational AI engine taking the world by storm.

We were particularly interested in what ChatGPT thinks of Windows Services, which are highly technical and often difficult to explain. Our company has been wrestling with them for years! 🙂

The rest of this article focuses on four questions we asked ChatGPT. For each question, we present the AI’s response and review the quality of the answer.

What is a Windows Service?

We figured we’d start with the basics. Here’s how ChatGPT defined a Windows Service:

  A Windows service is a program that is designed to run in the background and perform tasks without user interaction. Services are typically used to perform tasks that need to be run continuously, even when no user is logged in to the system.

Services are managed through the Windows Services Control Manager, which allows you to start, stop, and configure services on your system. You can access the Services Control Manager by going to the “Services” snap-in for the Microsoft Management Console (MMC).

Some examples of common Windows services include:

  • The Print Spooler, which manages print jobs and controls access to printers.

  • The Task Scheduler, which is used to schedule tasks to run at a specific time or when certain conditions are met.

  • The Windows Event Log, which records system events and allows you to view and manage event logs.

  • The Windows Update service, which checks for and installs updates for the operating system and installed applications.

Overall, Windows services are a useful tool for running background tasks and automating various system tasks and processes. They can help to improve the performance and reliability of your system, and can be configured to start automatically when the system starts up.

That’s a great answer. It’s accurate, provides examples and avoids the use of technical jargon. Impressive!

But many sites are great with definitions, which may be easier to source and regurgitate. Let’s increase the difficulty.

Why would I run an application as a Windows Service?

Next, we wanted to see how the AI tackles a real-world question that we are often presented with. Indeed, folks browsing our products often wonder why they should convert their application to run as a service.

ChatGPT posited:

  There are several reasons why you might run an application as a Windows Service:

  1. To perform tasks in the background: By running as a Windows Service, an application can perform tasks in the background, even when no user is logged on to the system. This can be useful for tasks that need to run continuously or on a schedule, such as data backup, virus scanning, or monitoring system performance.

  2. To provide services to other programs: By running as a Windows Service, an application can provide services to other programs, such as database access, web server functionality, or messaging capabilities.

  3. To improve system performance: By running in the background as a Windows Service, an application can help improve system performance by offloading tasks from the main user interface and allowing other programs to run more efficiently.

  4. To enhance security: By running as a Windows Service with a lower level of privileges than the main user interface, an application can help enhance security by preventing unauthorized access to system resources.

  5. To reduce maintenance: Because Windows Services run in the background and do not require user intervention, they can help reduce maintenance by running automatically and requiring less attention than other types of programs.

In summary, running an application as a Windows Service can be useful for performing tasks in the background, providing services to other programs, improving system performance, enhancing security, and reducing maintenance.

Another excellent answer!

We’ve been advising customers of the benefits of Windows Services for years and that response aligns with our thinking.

Let’s keep going. How does ChatGPT respond to a plea for help?

My Windows Service is stuck in the “Stopping” state. How do I fix it?

This is an issue faced by many of our customers (it’s covered in the Windows Services FAQ).

ChatGPT suggested a few practical remedies:

  If your Windows Service is stuck in the “Stopping” state and is not stopping or shutting down as expected, there are a few steps you can try to fix the issue:

  • Restart the service: Sometimes, simply restarting the service can resolve the issue. To restart the service, go to the Services control panel, right-click on the service, and select “Restart” from the menu.

  • End the process manually: If restarting the service does not resolve the issue, you can try ending the process manually. To do this, go to the Task Manager and find the process associated with the service. Right-click on the process and select “End task” to stop it.

  • Check the service logs: The service logs may provide information about why the service is not stopping as expected. To view the service logs, go to the Services control panel, right-click on the service, and select “Properties”. Then, go to the “Log On” tab and click the “Event Viewer” button to view the service logs.

  • Check for dependency issues: If the service has dependencies on other services, and those dependencies are not stopping as expected, this can cause the service to get stuck in the “Stopping” state. To check for dependency issues, go to the Services control panel, right-click on the service, and select “Properties”. Then, go to the “Dependencies” tab to see a list of services that the service depends on. If one of those services is not stopping as expected, this could be the cause of the issue.

  • Check for errors or issues in the service code: If none of the above steps resolve the issue, there may be an error or issue in the service code that is preventing it from stopping as expected. In this case, you may need to review the service code and try to identify and fix any errors or issues.

Another solid response. ChatGPT is 3 for 3!

But can the AI tell us something we don’t already know?

Tell me something obscure but useful about Windows Services

ChatGPT responded:

  One obscure but useful feature of Windows Services is the ability to specify a “dependency” on another service. When you specify a service as a dependency for another service, the dependent service will automatically start whenever the required service starts, and will automatically stop whenever the required service stops.

For example, suppose you have a service that performs data backups for your system. You might want this service to run every night at midnight, after all other user activity on the system has ceased. In this case, you could specify the “Workstation” service as a dependency for your backup service. The Workstation service is a built-in Windows service that manages network connections and file and printer sharing on the system. By specifying the Workstation service as a dependency, you can ensure that your backup service will only start when all network activity has stopped and all files are closed, which can help ensure that the backup process is successful.

This feature can be useful for setting up complex service dependencies and ensuring that services start and stop in the correct order. You can specify dependencies for a service using the “Dependencies” tab in the service’s properties in the Services control panel.

Interesting. This is the first time we’ve seen ChatGPT trip up.

While the ability to set a dependency is an advanced/obscure feature, there are a trio of problems with the answer:

  1. When you specify a service as a dependency for another service, it’s true that the dependent service will automatically start whenever the required service starts. However, despite what ChatGPT says, the dependent service will not stop when you stop the required service. The dependent service may keep running.

  2. Next, the example is inaccurate. Setting the backup service to depend on the Workstation service will not “ensure that your backup service will only start when all network activity has stopped and all files are closed”. That’s because the Workstation service doesn’t start or stop based on network activity.

  3. Finally, you cannot “specify dependencies for a service using the Dependencies tab in the service’s properties in the Services control panel”. In reality, that view is read-only and you can’t update dependencies there:

    Workstation service dependencies

But even more worrisome, the faulty answer has the air of authority. It will certainly seem plausible to folks unfamiliar with service dependencies — who will not be able to spot the inaccuracies!

Let’s try one more.

How do I find out who stopped my Windows Service?

This time, ChatGPT’s advice was on point:

  To find out who stopped your Windows Service, you can check the service logs in the Event Viewer. The service logs can provide information about when the service was stopped and who stopped it.

To view the service logs in the Event Viewer:

  1. Press the Windows key + R to open the Run dialog, then type “eventvwr.msc” and press Enter. This will open the Event Viewer.

  2. In the Event Viewer, expand the “Windows Logs” tree on the left and select the “System” log.

  3. In the System log, look for entries related to your service. These will typically be listed under the “Service Control Manager” source.

  4. Look for entries with the “Information” level that indicate that the service was stopped. These entries should include information about the time the service was stopped and the account that stopped it.

Keep in mind that the service logs may only contain information about the most recent service stops. If the service was stopped a long time ago, the log entries may have been purged.

You can also check the service’s properties in the Services control panel to see if the service is set to automatically start when the system starts up. If the service is set to start automatically, this could indicate that the service was stopped intentionally by an administrator or another service.

Conclusion: ChatGPT does a good job of answering questions involving Windows Services

Despite providing misleading advice in one situation, it seems that ChatGPT can be a credible source of information about Windows Services.

Indeed, in all our tests, ChatGPT’s provided answers that were relevant, free of techno-babble and full of actionable advice.

What’s your experience with ChatGPT?

Please leave a comment to let us know!

Posted in Windows Services | Tagged , , | Leave a comment

Q&A: Does AlwaysUp Support Multiple Automatic Logons?

Does AlwaysUp Support Multiple Automatic Logons?
   We’ve written utilities that control Microsoft Word to produce automated documents and, for various reasons, these have to be run visible in a “real desktop session” on a server, logged in as a real user, not hidden on session 0.

When we only need one logged-in user on a server to achieve this, we can use AlwaysUp with the “Autologon” feature. However, on some servers, we run our tool more than once, each copy running under a different user account, and so we can’t use that feature.

Do you have any suggestions in the current or new version of AlwaysUp please? LogonExpert looks like it can start multiple sessions under different real accounts. Perhaps some combination of this tool and AlwaysUp might work?

Thanks in advance!

— Robin

Hi Robin, good to hear from you.

Yes. If LogonExpert works as advertised, you should be able to use it in conjunction with AlwaysUp (and the Windows Task Scheduler) to solve your problem.

If I’m following, you want to:

  1. Setup multiple instances of Word, each to run as a service with AlwaysUp;

  2. Automatically log in multiple users when the computer boots;

  3. Have each account in (2) start one of the services created in (1) at logon.

Let’s review how you can achieve each step.

1. Setup multiple instances of Microsoft Word with AlwaysUp

This step is easy. AlwaysUp will let you create as many services as you like — even if each service runs the same application.

In your case, you should set a different account for each application on the Logon tab:

Specify an account on the Logon tab

Then each instance of Word will run as a different user.

No doubt you’ve already found our tutorial showing how to setup Microsoft Word with AlwaysUp. Despite the focus on Word 2010 there, the same instructions apply to all installed versions of Word, including Word 365.

2. Automatically log in multiple users at boot

Here’s where LogonExpert comes in.

Indeed, the product’s home page prominently states:

  Multi-user logon

Add and log on any number of users to one computer simultaneously using the application’s interface, command line, scripts or scheduling tools.

Hopefully it will be easy to set up all your accounts. We suggest taking advantage of the free 10 day trial to make sure that LogonExpert works as you expect.

3. Automatically start a copy of Word in each account at boot

Next, let’s ensure that each user’s instance of Word starts whenever the computer boots. We’ll need the help of the Windows Task Scheduler to do that.

If you’ve used Task Scheduler before, you know that it provides a convenient way to run a command at a specific time. But do you know that it can run a command whenever a specific user logs in too? That turns out to be a surprisingly useful capability!

Please review our step-by-step tutorial, How to Start your AlwaysUp Application “In Session” at Logon. Follow those instructions to create a scheduled task for each user you want to automatically log in and start Word:

Create a scheduled task for each user

4. One last change: Don’t start Word automatically from AlwaysUp

Finally, now that your AlwaysUp service and Word are set to start automatically at logon, you should change your AlwaysUp entry to start Manually. That’s because AlwaysUp no longer needs to start at boot as everything is triggered by the autologon and the subsequent scheduled task.

Make the change on the General tab:

Set AlwaysUp to start Manually

Putting it all together

With all this in place, here’s what should happen when your computer boots:

  1. LogonExpert logs in each of your users

  2. For each user:

    1. Windows runs the scheduled task as they log on

    2. The scheduled task starts the AlwaysUp service in your logon session

    3. AlwaysUp starts Word, visibly on the desktop

That’s it. Best of luck wiring everything together!

And please don’t hesitate to get in touch with our support team if you run into any obstacles.

Posted in AlwaysUp | Tagged , , , , | Leave a comment

Q&A: Why isn’t my File Removed from Dropbox?

Why isn't my File Removed from Dropbox.com?
  I’m testing your AlwaysUp with Dropbox. So far everything works great except for one case. When I delete a file from Dropbox.com online, it’s not removed from my hard drive. The file just stays in the local folder.

I’m a bit confused because new files I add on the computer show up online quickly (and vice versa). It’s only deleting that’s not working.

Have you ever seen this before?

— Wendy McIntosh

Hi Wendy. Thanks for trying AlwaysUp!

Yes, I think we have seen that before. It’s very likely that Dropbox is stuck trying to get your attention.

Dropbox is probably waiting for input from you

Obviously, Dropbox is a regular Windows desktop application. As such, it expects to be able to interact with you as it copies your files to and from the cloud.

And you’ve probably encountered one or more desktop notifications as Dropbox moves files around. For example, this informative alert appeared after we uploaded one of our favorite recipes to the cloud:

Dropbox desktop notification

Notifications like those can be helpful, but you may not see them when Dropbox is running with AlwaysUp. In fact, you won’t even see the Dropbox tray icon or any windows from Dropbox on your desktop. That’s because Dropbox is working “invisibly” in the background — on the isolated Session 0 desktop where all Windows Services operate.

In any case, your inability to see simple notifications like the one above shouldn’t pose any problems. That’s because Dropbox will automatically create and destroy those alerts without you ever setting eyes on them. And even though you may be less informed, Dropbox will continue to synchronize your files as expected.

However, the story is different for prompts that need you to take action before proceeding. They patiently wait for you to do something, even though you have no idea that they exist!

Unfortunately Dropbox may show one of those prompts when you remove a file online. And that may be holding up the action. Let’s see if that’s the case.

Start Dropbox normally and look for a “Delete file” prompt

To check if Dropbox is trying to get your attention:

  1. Stop Dropbox in AlwaysUp

  2. Start Dropbox normally, without AlwaysUp.

Dropbox should now be running on your desktop.

Do you see this prompt on your screen?

Do you really want to delete the file?

As the window says, Dropbox is confirming that the file you removed online should be deleted from all devices. And, most importantly, Dropbox will not remove the file from your PC until you click the “Delete everywhere” button. It’s stuck, waiting for your approval.

Be sure to check the “Don’t ask me this again” option

As you can expect, dismissing the window will allow Dropbox to proceed and remove your file.

But before you dismiss the window, please check the Don’t ask me this again box:

Check the don't ask box

Checking that box will ensure that you’re never interrupted by that window again. And that’s exactly what you want/need as Dropbox runs invisibly in the background with AlwaysUp.

Spot any other problems?

And while you’re here, please have a look around. Is Dropbox reporting any warnings or failures? Click its tray icon to find out.

If you do notice a problem, please do your best to resolve it before returning to AlwaysUp. As you can imagine, if Dropbox doesn’t work on its own, it won’t magically work under AlwaysUp either.

Best of luck!

Posted in AlwaysUp | Tagged , , , | Leave a comment