The Core Technologies Blog
Our Software // Windows Services // 24×7 Operation
In recent months, several customers running OneDrive as a service have complained of torturously slow uploads. Files created on a PC take a very long time to appear in the cloud. In one case, it took more than 3 days for a small Word document to show up on OneDrive’s website!
The first instinct was to suspect AlwaysUp. Perhaps running as a Windows Service had somehow crippled OneDrive. But a few tests quickly disproved that theory. The performance problem showed up even when OneDrive was started normally on the desktop, outside of AlwaysUp.
The mystery has persisted for several months but recent feedback on various forums suggest that there may be a workaround. Apparently disabling the new Files On-Demand feature often restores sanity.
What is OneDrive Files On-Demand?
Files On-Demand is Microsoft’s attempt at making more efficient use of your hard drive. Instead of automatically transferring each file in the cloud onto your PC as soon as possible, OneDrive will delay the transfer of each file until you explicitly open it.
You can turn Files On-Demand on or off from your OneDrive Settings window. Right-click on the OneDrive tray, select Settings from the menu and move to the Settings tab in the window that comes up. The Files On-Demand option appears at the bottom of the form. It appears to be on by default:
Files On-Demand trades space for speed of access. For example, let’s say you have a 10 MB PowerPoint presentation in the cloud. Without Files On-Demand, that document will be automatically copied to your computer, immediately consuming 10 MB on your hard drive. With Files On-Demand, OneDrive will “know about” the file but will not automatically transfer it. Your hard drive stores 10 MB less — great.
But the downside of Files On-Demand becomes evident when you need to use the file. Without Files On-Demand, you simply double-click the file and away you go. The document loads quickly because it is already on your computer.
With Files On-Demand enabled, double-clicking the PowerPoint issues a command to the cloud to dynamically download the file. At best you wait a few seconds for the download to complete and the file to open; at worst you can’t retrieve the document because you are not connected to the Internet.
As contributor Craig Long points out, “Files On-Demand is for those who have limited space available or for those who only occasionally need to open a file”. It’s a fine choice for individuals/hobbyists looking to conserve precious resources.
However, please be cautious when considering Files On-Demand in a professional setting. It would be a disaster in an office where OneDrive is mapped to a shared folder because the files not downloaded would never fully show up on the shared drive!
And furthermore, as Microsoft mentions, “you cannot search the contents within online-only files because they aren’t stored on the device” — a potential deal-breaker in a commercial environment.
Complaints of slow uploads with Files On-Demand
Several folks experiencing slowness were able to speed things up by disabling Files On-Demand. Here is one data point from the popular OneDrive forum hosted by UserVoice:
I have been waiting a week for the sync to complete, speeds is about 0,2kb/sec. My internet speed is 1GB/1GB. Then I turned off “sync on demand”. BOOM!!! Speed up to 15mb/sec. A factor 75.000 faster.
“John S” had a similar comment:
I had this same issue with large upload batches from my Mac (uploading about 13GB worth of data from a prior DropBox repository into a SharePoint location on Office 365 tenant) and figured out resolution myself after unsuccessful calls to MS Support: SOLUTION: turn OFF “Files on Demand”. Once off, I got normal upload speeds.
Apparently there may be problems with the new feature.
How to disable Files On-Demand
You can easily turn off Files On-Demand by un-checking the box on OneDrive’s settings page (available by right-clicking on the tray icon). Click OK on the conformation window to commit your changes:
Hopefully this simple change will put the spring back in OneDrive’s step!
What is the Spooler service?
The Windows Print Spooler is a key operating system component that manages all printing on your computer. It is started when your PC boots and runs unattended, 24×7 as a Windows Service.
The Windows Service is named Spooler and its display name is Print Spooler. The service runs inside a process called spoolsv.exe:
Runs silently in the background
The Spooler does not show any windows or tray icons. It is an invisible technical component that presents an Application Programming Interface (API) to programs looking to manage printing.
Accepts files to be printed, from all applications
The Spooler is always listening for print requests. It accepts documents from any application running on your computer.
The process of handing off a document to the Spooler is called Spooling. Once an application is done spooling a document, the Spooler is responsible for the actual printing. The application can go back to its normal tasks.
For example, let’s say you’re printing a spreadsheet from Microsoft Excel. You will notice a brief period as Excel prepares the document and hands off the print request to the Spooler. And during that time, a helpful window will announce that Excel is printing. However Excel is really sending the spreadsheet to the Spooler (i.e. spooling):
After the window has disappeared (i.e. Excel is done spooling), you will be free to edit your spreadsheet while the actual printing proceeds simultaneously. You can even close Excel! None of that matters to the Spooler, which will ensure that your spreadsheet makes it to the printer — independent of Excel.
Facilitates concurrent printing
Ever printed several, lengthy documents at the same time? The Spooler makes that possible — without overwhelming your printers.
The Spooler maintains a queue of requests (a print queue) for each printer on your computer. When you print a document, the Spooler:
- Adds a new item (a print job) to the print queue.
- Sends the print job to the printer (when the printer is ready).
- Monitors the printer as it produces pages.
- Removes the job from the queue once the printer has produced all pages.
Windows allows you to see (and manage) each printer’s queue. To open a print queue:
Open the Control Panel (available from the Start menu).
Type the word printers into the search box and click the View devices and printers link on the left:
Find your printer in the list. Right click the printer and select See what’s printing from the menu:
A window showing all pending print jobs will come up. Here we see one item for Administrator — a text file printed from the Notepad application:
From there, you can cancel all print jobs (“clear the queue”), pause a specific job or stop printing altogether.
Will do everything in its power to ensure that documents are printed
The Spooler’s mission is to make sure that all your documents are printed — even if there is a brief outage or interruption.
For example, if your printer temporarily disappears from the network, the Spooler will wait a reasonable time for the device to come back before declaring a failure.
And if your request to print a single page is stuck behind a 200-page behemoth, the Spooler will ensure that your document gets its turn, eventually.
What happens if I stop the Spooler service?
Nothing can be printed when the Spooler service is stopped. And if you try to print without the service running, Windows will insist that no printers are installed:
Indeed, when the service is running, printers show up as ready and waiting. Printing works fine:
But all printers become inaccessible the instant the service is stopped:
Is it safe to disable the Spooler service?
If you don’t have any physical printers attached to your computer and you and never plan to do any printing, you can safely disable the Spooler service.
However, watch out for applications that silently use the printing API. They will also fail when the service is disabled.
What should I do if the Spooler service isn’t working?
If the Spooler is misbehaving, you should restart it. You can do so from the Services Control Panel application, or by running a couple of NET commands:
NET STOP Spooler
NET START Spooler
Be sure to run those commands from an elevated command prompt, otherwise they will fail with permissions errors.
I made a mistake. How do I cancel all printing?
To clear all printing, open the printer queue (see above) and select Cancel All Documents from the Printer menu:.
Give the Spooler (and your printer) a few seconds to respond to the request.
Canceling didn’t work. Is there another way to clear out all pending documents?
Try running this sequence of commands to stop the Spooler, remove all files from the print queue, and restart the service. You will need to have admin rights:
NET STOP Spooler
DEL /Q /F /S C:\Windows\System32\spool\PRINTERS\*
NET START Spooler
The Spooler service won’t start (Error 1053)
As reported in Microsoft’s technical forum, the problem may be with “desktop interaction” — an obscure windows service setting.
To fix the issue:
- Open the Spooler service (from the Services Control Panel application)
- Switch to the Log On tab
- Un-check the Allow service to interact with desktop box:
- Click OK to save your change.
Afterwards, you should be able to start the service.
The Spooler service is stuck in the “Stopping” state — Help!
In that unusual situation, find and terminate the spoolsv.exe process from the Task Manager (admin rights required):
The service should transition to the stopped state.
The Spooler service keeps stopping for no reason. How do I keep it running?
Our Service Protector utility may be able to help. Please follow this step-by-step tutorial showing how to protect the Spooler service.
If you would like to know more about the Windows Print Spooler service, or you have a specific problem, please feel free to get in touch. We will do our best to help you!
We are currently using AlwaysUp with several executable instances. We need to have these restarted daily due to memory leaks from the application.
I don’t see a scheduling restart option in AlwaysUp. I think this could be done through a windows task but I see that these are being run as windows services. Would you recommend doing this as a windows task or would the Service Protector be a better option?
— Kevan Hauver, AAA Northeast
Hi Kevan. Sorry to hear of the awful memory leaks!
Yes, Service Protector could help your situation but there is no need to purchase that additional software. Here are a couple of options to restart your application periodically:
Restart once daily (via the Monitor tab)
AlwaysUp makes it very easy to restart your application once per day, at a time of your choosing. Edit your application in AlwaysUp and look for the Every setting on the Monitor tab.
Here is what the Monitor tab looks like when configured to restart the program every day at 2 AM (a time when the software/server is likely to be “quiet”):
Note that AlwaysUp can restart conditionally — only when one or more conditions are met. For example, to avoid restarting when the software is busy, check the It has been idle for at least box and fill in an appropriate duration.
And if you find that simply restarting the application doesn’t clear the problem, you can try rebooting the entire machine. That option is available at the bottom of the form.
Restart multiple times per day (using the Windows Task Scheduler)
If restarting once per day is not enough, you have my sympathies!
For that situation, we recommend creating a simple script that will restart your service and then enlisting the Windows Task Scheduler to restart the service as often as you like. Follow these steps, which you should be able to complete in 10 minutes or less:
Step 1: Create a batch file to restart your AlwaysUp service
First, please create a batch file that restarts your AlwaysUp service. It will contain two lines — one to stop the service and another to start it.
For example, if your AlwaysUp application is named “Dropbox”, your batch file should contain the following calls to the Windows NET command:
NET STOP "Dropbox (Managed by AlwaysUpService)"
NET START "Dropbox (Managed by AlwaysUpService)"
The ” (Managed by AlwaysUpService)” portion is a necessary part of the service’s name. All services created by AlwaysUp feature that suffix.
Note: The batch file may not work as expected if it takes your application longer than 30 seconds to shut down. This is because NET STOP will only wait for 30 seconds before giving up. And if it does give up, the subsequent call to NET START will fail too. So after running the batch file, the AlwaysUp service may end up in the “Stopped” state — not what you want for your 24/7 application!
For slow applications, we recommend using our free ServicePilot utility instead of NET. ServicePilot can be configured to wait much longer than 30 seconds for the service to stop.
Assuming that you have downloaded and saved ServicePilot to your AlwaysUp folder, here is what the batch file looks like with ServicePilot instead:
"C:\Program Files (x86)\AlwaysUp\ServicePilot.exe" -restart -wait 300 "Dropbox (Managed by AlwaysUpService)"
That command will wait for up to 300 seconds (5 minutes) for the service to restart.
Give the batch file a meaningful name and save it to your AlwaysUp folder (C:\Program Files (x86)\AlwaysUp). We’ll need its full path in the next step.
Step 2: Setup the Task Scheduler to run the batch file
Here’s how to run the batch file (and restart your application) every day at noon.
Start Task Scheduler. This is best done by running taskschd.msc from a command prompt, or by opening the Control Panel, searching for “schedule” and clicking the Schedule tasks link:
Once the Task Scheduler window appears, select Create Basic Task on the left:
In the Create Basic Task Wizard window, enter a suitable name. You can leave the description blank.
Click Next to proceed.
The Daily option (which we want) should already be selected, so click Next to move to the next screen:
Here you specify the time to restart the service/application. We have selected today at noon but you should select whatever time works for you.
Leave Recur every at 1 day and click Next when you are ready to proceed.
We want to start a program (the default), so click Next to move on:
Click the Browse button and choose the batch file you created in the previous step. Recall that we placed ours in the AlwaysUp folder (C:\Program Files (x86)\AlwaysUp):
Click Next to proceed.
The basic configuration is now complete and you will see a summary of the scheduled task to be created.
Check the Open the Properties dialog… box and click the Finish button:
And on this final screen, select the Run whether user is logged in or not option and check the Run with highest privileges box. These are required by Windows to manipulate the service on your behalf.
Click OK to wrap up. (On some versions of Windows, you will have to enter the password for your account on the way out.)
Your task is now fully configured. Navigate into the Task Scheduler Library on the left and confirm that all is well:
With this new task in place, Windows will automatically restart the AlwaysUp service every day at noon.
Step 3: Repeat the process to configure additional restarts
Want to restart again at 2 PM? Simply repeat the process to create another task but select 2 PM instead of noon.
Advanced users can save a few clicks by exporting the task to a XML file, updating the file to specify a different time, and importing the modified XML to create a new task.
Hopefully you don’t have to create too many tasks…
Best of luck with your application!
I must run a Computer Aided Engineering (CAE) application as a service but it doesn’t work with AlwaysUp. I guess that Visio is the problem because the startup phase of the tool runs up to the Visio initialization (via COM) and then hangs. When I try to register Visio standalone, it’s also not working.
Any idea what I can do to isolate the problem?
— Rüdiger Lange, AUCOTEC
Hi Rüdiger. You are likely running into a couple of problems. Here are our recommendations to resolve the issues:
Specify the correct Windows account in AlwaysUp
Your CAE application needs to run in the Windows account where Visio was installed. If not, your tool will fail when it tries to start Visio.
You see, when you installed and configured Visio, it saved several settings in your account. Those settings are not accessible to other users of the computer.
Even if another user found and launched the Visio executable, Visio would start, but it may come up “blank”. Whatever settings you provided at installation (and any changes you subsequently made while using Visio) may not be visible.
So please enter the user name and password of your Visio Windows account on the Logon tab to have AlwaysUp start your CAE application in that account. For example, here we have configured the “Administrator” account:
Start Visio as a Windows Service too
AlwaysUp will run your CAE application in the background, in the isolated Session 0. Now because COM components cannot communicate easily across login sessions, Visio must run in the same session. Therefore, you should also launch Visio as a Windows Service with AlwaysUp.
We don’t have a tutorial for Visio but setup should be the same as for any application in the Microsoft Office suite. Here are the guides for:
But please be aware of the following cautionary note from Microsoft for when running an Office program as a Windows Service:
All current versions of Microsoft Office were designed, tested, and configured to run as end-user products on a client workstation. They assume an interactive desktop and user profile. They do not provide the level of reentrancy or security that is necessary to meet the needs of server-side components that are designed to run unattended.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
That sounds pretty bad, right? However, in our experience, there is a large subset of Office features that work perfectly fine unattended.
However please heed the Redmond warning and test thoroughly, to make sure that your automation functions as expected in the background in Session 0. We will be here to help you if you run into any trouble!
AlwaysUp version 11.5 is now available for download!
This release delivers a handful of important changes, along with the usual under-the-hood refinements.
“Switch to Session 0″ removed when it’s not supported
As you may have noticed, Microsoft has crippled access to Session 0 in Windows 10 Build 1803 and later. And even though the writing had been on the wall for some time, we were still disappointed to see that convenient functionality removed from Windows.
But we live in Microsoft’s world, and we must react to their dictates as best we can.
So going forward, AlwaysUp will scan the operating system and determine if Session 0 is accessible or not. If it’s not, then:
Note that your application will continue to run properly as a Windows Service in the isolated Session 0 — you just can’t see it there. You can always select Application > Restart in this session from the menu to bring your program visibly onto your desktop.
View & set Windows Service “Read” permissions
While AlwaysUp would allow you to set who can start, stop or modify each Windows Service it creates, the interface could not show (or grant) someone the ability to simply read the service. This shortcoming was recently addressed in Service Security Editor and we have now done the same in AlwaysUp.
Select Application > Advanced > Service Security Settings to interact with the new “Read” element:
Technical enhancements for Windows Server 2019
Windows Server 2019 was released in October (and re-released in November after some disturbing technical glitches were addressed). AlwaysUp version 11.5 includes minor technical tweaks to ensure smooth, 24/7 operation of your Windows Services on Server 2019.
You can rest assured that AlwaysUp is fully compatible with the new OS.
Other fixes & improvements
Improved support for the latest builds of Windows 10 and Windows Server 2016. Each major update was thoroughly tested and no issues were found.
The registration window now displays the version number — to help customers complete registration on the correct version of the software.
The registration process provides additional labels and informative pop-up messages to help customers complete the process without incident.
The enhanced “Help” menu includes a link to our Blog and a link to an article describing how to report problems.
When AlwaysUp is running in evaluation mode, the title of the main window now mentions when the 30-day trial will expire.
As usual, please review the release notes for the full list of features, fixes and improvements included in this release.
Upgrading to AlwaysUp Version 11.5
If you purchased AlwaysUp version 10 (after January 2017) you can upgrade to version 11.5 for free. Just download and install “over the top” to preserve your existing applications an all settings. Your registration code will continue to work.
If you bought AlwaysUp version 9 or earlier (before January 2017), you will need to upgrade to use version 11.5. Please purchase upgrades here — at a 50% discount.
See the full upgrade policy for additional details.
Every now and then, someone reviewing our AlwaysUp software declares it “too expensive”. They ask: “Since I can find free tools (like Microsoft’s Srvany) to run my application as a Windows Service, why in the world would I spend $50 on your software?”
Sure, not everyone looking to run a program as a service needs AlwaysUp. A free tool can be a fine choice, especially for hobbyists and home users.
But if you are a professional working in a commercial environment, please be sure to answer these five questions before making a commitment:
1. Where will you go for help if you have questions (or things go wrong)?
The wonderful world of Windows Services can be tricky to navigate. Technical obstacles (like Session 0 Isolation) abound.
As a professional, you owe it to your business to plan for all eventualities.
- Is there a phone number to call when you or your team needs urgent help?
- How about a support email with a 24-48 hour response time?
- Can you easily find online FAQ’s and other helpful resources?
At minimum, please make sure you have a contact!
2. How much of your own time will you have to spend on the “free” solution?
The cost of an item is usually more than its initial, sticker price. We often underestimate true, long-term cost because we forget to add our time to the equation.
For example, say you want to buy a new computer desk. Which is cheaper?
- A ready-to-go desk for $199
- The same desk from Ikea for $149
It’s a no-brainer, right? #2 is the way to go.
But what if it’s going to take you a couple of hours to unbox and assemble the Ikea furniture? Does option #1 (which avoids that extra labor) seem the more cost effective choice now?
Similarly, a free alternative to AlwaysUp definitely saves a few bucks at first.
But once you have the free software, how much of your valuable time must you devote to installation, troubleshooting and support? Might those ongoing costs dominate the equation?
We realize that your time is important. And we designed AlwaysUp to save you time — initially and over the many months and years you will use the product.
How much is your time worth?
3. Are you willing to take on the additional risk?
When you use unsupported software in your business, you become responsible for it when it fails. The buck stops with you.
Are you willing to assume that risk? To accept blame from your boss/team if the software misbehaves or becomes unusable after a Windows update?
Realize that your reputation (and perhaps your job) may be at stake, especially if you are operating a mission-critical system!
4. Are you sure you won’t need AlwaysUp’s extra features?
With over a decade of real-world use, AlwaysUp has evolved to include a ton of features — many of which are not found in free alternatives.
For example, AlwaysUp can:
- Automatically restart your application if it crashes, hangs, or uses too much CPU
- Send you an email when your application stops;
- Boost your application’s priority, to make it run faster;
- Capture your application’s output to a text file;
- Send you a weekly report showing how your application is performing.
Check out this PDF flyer comparing AlwaysUp and Srvany for more:
As many customers have discovered, these extra features can come in very handy down the road!
5. How important is security?
Needless to say, you should be very careful when introducing new software into your secure environment.
AlwaysUp is digitally signed, so you can be positive that it is from our reputable company:
In addition, AlwaysUp has been evaluated by the US Department of Commerce Bureau of Industry and Security and has earned an export classification of EAR99:
Can you say the same for the free software?
Have you heard? Microsoft is set to release Windows Server 2019 later this year. It seems that consumer releases (like Windows 10) are launched with trumpets and parades while server releases sneak up on you in the middle of the night!
So what’s new in Windows Server 2019?
Here are our highlights from the August 2018 Insider preview (Build 17744):
Windows Admin Center (WAC): Microsoft’s powerful browser-based server management tool is a one-stop-shop for administering PC’s — locally or remotely. Check out our review of WAC for a deeper look.
Windows Defender Advanced Threat Protection (ATP): Beyond the traditional preventative protection technologies found in previous versions Defender, ATP features support for post-breach intrusion detection, automated investigation, and more.
Improved Security for Linux VM’s: Linux virtual machines can now benefit from Server 2016′s Shielded Virtual Machines technology, which can help to prevent the unauthorized copying of company resources.
Support for Kubernetes (in Beta): Administrators running Kubernetes pods will be happy to see first-class support for the popular container technology in Server 2019. This beta version is a respectable start and we look forward to continued improvements on the way to a general release early next year.
Any updates for Windows Services?
Server 2019 brings no documented changes to the Windows Services SDK functions. The Services Control Panel application remains the same as it has for many years now.
The only significant difference is the removal of the Interactive Services Detection service, which makes it impossible to access Session 0 in Server 2019. This is not a surprise though; Microsoft is being consistent with the same change made in Windows 10 build 1803 (released in April).
Does AlwaysUp work with Server 2019?
Our week-long testing with various applications failed to uncover a single defect or problem.
Here is AlwaysUp happily running Dropbox as a Windows Service:
Does Service Protector run fine too?
The story was the same with Service Protector. No problems at all on Server 2019.
Here we see Service Protector protecting the Windows Defender Firewall Service:
And how about all your other utilities?
Thumbs up there too!
Where can I find out more about Windows Server 2019?
I run a Java program EchoLink Proxy as part of Ham Radio networking. A routine update replaced the Java folder with its new version number thus my AlwaysUp Application field to run the program needed manual edit from:
C:\Program Files (x86)\Java\jre1.8.0_171\bin\java.exe
C:\Program Files (x86)\Java\jre1.8.0_181\bin\java.exe
I tried simply providing “Java.exe” (which works from a CMD prompt) but AlwaysUp requires the full-path. How can I get AlwaysUp to run the Java.exe in my PATH environment variable?
Hi. AlwaysUp expects a full path, so I see the problem!
We recommend adding a “layer of indirection” to solve the problem. Please:
Create a new Windows batch file that runs your full java command line. However, instead of specifying the full path to java, simply use java.exe.
When run, the batch file will use whatever java.exe is in your Windows account’s PATH variable.
Here is what our simple batch file (saved to “C:\Tools\start-java-app.bat”) looks like:
Please open a command prompt, run your batch file and confirm that it launches your program (EchoLink Proxy) as you expect.
Update your AlwaysUp entry to run the new batch file. Specify the full path to the batch file in the Application field on the General tab:
Be sure to clear the Arguments field if it contains the parameters for the Java command line! Those should already appear in the batch file.
And on the AlwaysUp Logon tab, specify the Windows account you are logged in to right now. Java must be launched in this account so that it finds the correct PATH environment value.
Finally, update the new batch file to add a 5 second delay at the end. We recommend using the Windows TIMEOUT command, but there are several alternatives:
timeout /t 5
Without this adjustment, the batch file may exit very quickly and fool AlwaysUp into thinking that the batch file failed to start properly.
Save your batch file — and your settings in AlwaysUp.
Now, when you start your modified entry from AlwaysUp, the following will happen:
AlwaysUp will start the batch file
The batch file will launch Java from the PATH, as you have configured
The batch file will “sleep” for 5 seconds
The batch file will exit
AlwaysUp will notice that the batch file has exited and “attach” to the Java.exe child process
AlwaysUp will continue to monitor Java.exe and restart it (via the batch file) if it ever crashes/fails/exits.
Any monitoring, reporting and alerts you have configured should continue to work as they did before.
Please let us know if you run into any trouble implementing this approach!
We have a VB6 application we’re running as a service in AlwaysUp on Windows Server 2012 R2. When we run the application outside of AlwaysUp, the form refreshes fine. When we run the application in AlwaysUp, it can sometimes take several minutes for the form to refresh, starting out as a black form (see screenshot of Session 0 below). Any recommendations you might have to help with the refresh rate would be appreciated, thanks.
— Jim Kinghorn, Taylor Technology Services
Hi Jim. You are running into one of the peculiarities of Session 0 — where user interface elements do not seem to be refreshed consistently. Unfortunately it is a “Windows thing” and is outside the control of AlwaysUp.
But all is not lost! Our development team took a look at your situation and concluded that calling the Windows RedrawWindow API function in Session 0 might fix the problem.
You have a couple of options:
Option #1: Update your code to refresh all windows periodically
Specifically, your code should:
Refresh the desktop window, by calling the VB6 equivalent of:
RedrawWindow(NULL, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN)
Enumerate all top-level windows (using the EnumWindows API function) and call RedrawWindows on each visible window.
Performing those operations every few seconds should eliminate the black windows in Session 0.
Option #2: Setup our “RefreshWindows” utility to run in Session 0
If updating the code is not a viable option, you can:
Download our free RefreshWindows command line utility and save it to a folder of your choice. When run, the utility refreshes all windows every 5 seconds (using the RedrawWindows and EnumWindows functions as recommended above):
Set it up as a Windows Service with AlwaysUp. All you should have to provide is the full path to the executable file on the “General” tab:
When your machine boots, AlwaysUp will launch RefreshWindows.exe to ensure that all windows in Session 0 are periodically refreshed and properly drawn.
Microsoft has finally done it. Session 0 is officially off limits.
The Interactive Services Detection Service — necessary to switch to Session 0 — has been removed in Windows 10 Version 1803 (released in April 2018). While applications running in Session 0 will happily create windows and prompts, no one will be able to see them.
But this is no big surprise. The geeks in Redmond have been marching in this direction for many years.
A brief history of Session 0 and Interactive Windows Services
Windows NT (1993)
The concept of multiple login sessions in solidified in this foundational release of Windows. Session 0 is created at boot, interactive Windows Services are supported and the first user to log in is placed in Session 0.
Windows Vista (2007)
To avoid shatter attacks, Vista prohibits users from logging in to Session 0. That new world order is dubbed “Session 0 Isolation”. The Interactive Services Detection service is introduced to allow users to temporarily access Session 0 — a band-aid for interactive Windows Services that show windows and prompts.
Windows 8 & Windows Server 2012
Microsoft continues to discourage interactive services. The NoInteractiveServices registry value, which enables the Interactive Detection Service and switching to Session 0, is set to 1 by default. This prevents anyone from switching to Session 0 (unless the registry is updated).
Windows 10 & Windows Server 2016
The keyboard and mouse no longer function in Session 0. This unwelcome behavior was widely thought to be a bug that Microsoft would eventually resolve, but it now looks like a deliberate action intended to cripple interaction with Session 0.
Windows 10, version 1703 (2017)
Microsoft promises to remove the Interactive Services Detection service in this Spring Creators Update but for some reason the service remains.
Windows 10, version 1803 (2018)
The Interactive Services Detection service is officially removed. Switching to Session 0 is forbidden.
So what exactly are the ramifications of losing the Interactive Services Detection service?
Consequence #1: You won’t be able to switch to Session 0 from AlwaysUp on Windows 10
While your application will continue to run as normal in Session 0, attempting to switch to Session 0 will result in an error (reported on the Status Bar):
To see your application’s windows on your desktop, please restart your application in the current session. That option is available from the Application menu:
Consequence #2: Our Switch to Session 0 utility won’t work on Windows 10
Switch to Session 0 will run happily in your taskbar but you will encounter an error when you try to switch. Not surprisingly, the message says that the Interactive Services Detection service “does not exist as an installed service”:
Sayonara Session 0!