SN 826: The Kaseya Saga

Beep boop - this is a robot. A new show has been posted to TWiT…

What are your thoughts about today’s show? We’d love to hear from you!

Hello! At 0:36:25 of this episode, you ask if you can still print if you disable the print spooler. Then you both agree that you can. I’ve disabled the print spooler service on many different Windows OS computers; and the printers, whether they be networked or local, all disappear when it’s disabled. When trying to print from an application, no printers show up and often they tell you that you need to install a printer to be able to print (with the print spooler service disabled). So, please help me understand how you can print with the print spooler service disabled.

Thanks for the informative podcast!

1 Like

I believe the only other option is for directly attached printers. If your printed is attached to the PC you want to print from, you may try installing it again, and looking for the option to “print directly to printer”. (You may be able to reconfigure your existing configuration, but I am not sure, and you could just rename that and keep it as a backup.)

Googling on the topic is barely helpful, but you can see the properties here in this item related to a specific printer configuration:

Okay, I think I understand. I was assuming they meant to disable the print spooler service. You’re suggesting they meant not to disable the service, but rather bypass the local spooler via the printer properties and print directly to the printer? I can get behind that.

I think you need to disable the spooler to disable the risk, but you should still be able to print directly to a printer if you install the driver in that configuration. I thought, when I listened, they implied this would be automatic if you disabled the spooler, and perhaps in the past it might have been, but it looks like in modern Windows you have to choose the “printer” in the list (which is really just a configuration on how to contact/control the printer) for the situation.

1 Like

@Leo
One thing I found interesting was, that Steve said he was going to write some test cases for Spinrite and set about testing it. Great news.

But… I was taught, never test your own code. In Steve’s case, as a one-man-band, that is difficult.

More importantly, we were trained that you write your test cases before you start writing any code. You have the specification and you write your test cases based on the specification, before the code is written, because you know what the specification requires.

If you write test cases after you have written the code, it is very easy to let tests slip, because you “know” what you’ve written and what the code you wrote should do, so that colours your tests. If you misunderstood the spec or mis-implemented a bit of code, it is all to easy to write the test case based on the false assumptions in the code.

If the test cases exist before the code is written, they are not influenced by your knowledge of the code you have written.

I would be very interested to hear Steve’s input on that topic. Did he have different training? Was he taught to do things differently? Or is it just the time constraints?

Likewise commenting, you discussed a couple of weeks back about whether TBL’s original “Internet” code had the comments added at a later date. Judging by the comments I’ve seen in the code, they look like period comments.

Again, we were taught, you comment your code before you write it. Likewise, you document changes to the code before you make those changes. That way, you know what the code should do. Any discrepancies and you can go back to the comments to see what it is supposed to really be doing.

On large teams, this is a life saver, as you don’t need to keep asking people what they meant, when they wrote obscure code, because it is clearly documented, what it should be doing - at least function descriptions of inputs and outputs and descriptions of complex sections of code. If the code doesn’t match the description of the output, you know that somehow the function code was botched!

These tenets are still things I take to heart today, when writing code for fun. I still always put in detailed header comments and inline comments (where appropriate), before I write the code.

Test Driven Development (TDD) is definitely an approach pursued by some. I’ve heard people say that you should never write a single line of code that wasn’t satisfying a test case.

I don’t work that way, as I never found that was the best use of my time. Neither do I spend much time on documenting code. I design a system and write down the design in a design document, but I see no value in comments like “this function writes the configuration to config.xml” when the function is named writeConfigurationToConfigXML(). To some extent, I believe in writing code that reads as much as possible as documentation itself. I do comment anything too strange or difficult to see obviously… but I’d prefer to not have that kind of code to begin with, if possible. Don’t be over-optimized and clever, be efficient and clear.

As for test cases, I start by writing a set of cases to make sure that the method or class does what it is designed to do. For example if it’s supposed to average some numbers, I will manually make up some numbers, manually calculate the average, and then make a test case for my manual calculations (commenting that I made manual calculations so someone knows where my numbers came from.) Then I will write and debug the code so that it works as expected for that/those test case(s). Once I think the code is working, then I will add the protective/destructive test cases to make sure it stays working in the face of adversity. Maybe not everyone is good at the “adversity” style of thinking, but I seem to be pretty good at it, and it has always worked well for me.

I once worked with a gentleman who wrote an 800+ page detailed design document, for like a year, before he wrote a single line of code. He said that was the only way he could be sure his code worked as designed. And perhaps it would have had he finally got to writing something… but he took too long, got taken off the project, and someone else had to write the code according to his document. That didn’t work out well at all. In my opinion, he should have been doing some iteration… to learn what he needed to learn from practice, rather than trying to think his way through something so complex. I believe this is why Agile has become so popular… iterate quickly so you can fail quickly, and learn from your failure for the next iteration, repeat.

Agile is fine, as long as it isn’t mission critical or internet exposed. I don’t really want my data on a platform that hasn’t bothered to implement security yet, because it is “failing fast”.

I agree with you, in part. But I’ll counter with a project, where the use cases were clearly defined, a design document with all classes, methods and properties clearly defined. The design took about 6 months, was signed off by the users, a team of 3 wrote the ~75,000 lines of associated code in 4 months, 2 months testing and in 3 years of live use, we had 2 bug reports, one of which was a bug in Windows Internation English edition.

(Windows has a localization routine, which, given the month number as a parameter, it returns the month name in the local language. Works fine on US English, UK English, German, French etc. But we had a lot of users on the International English version of Windows. The Win32 call, when set to use Int. Eng. returned : 1 = January, 2 = January, 3 = January, … 12 = January!)

I’d be shocked if Steve does “test-driven design” in the modern sense. He may not even be aware it exists. He and I come from a much older “waterfall” era.

I’ve learned to use TDD, much to my benefit, and it’s really fun and exciting. When you write the tests before you write any code there’s such a great feeling when they finally succeed. The language I use most, Racket, has elaborate testing facilities, including fuzzing, that really can give you confidence that your code works.

https://beautifulracket.com/explainer/unit-testing.html

I also doubt very much that MASM has any test functionality at all.

I’ve been using TDD for over 30 years. I started with Z80 and 8080 Assembler and BASIC, then moved onto COBOL.

You can write test-straps in any language. More modern languages, like Racket bring testing tools with it, but even with Assembler, you still have things like Machine Code Monitors to trace through the code. I remember bringing many an hour single stepping through my assembly code on my Memotech MTX500 - it was absolutely brilliant, BASIC, Assembler, Machine Code Monitor, hardware sprites, it took the best bits of the C64 and the BBC Micro and rolled them into one lovely package. The black anodized, brushed aluminium case was beautiful as well, a sleek C64 looking thing is MiB look. Still the sexiest computer I ever owned.

It is currently on display in a little electronics shop in Stadthagen, in Germany.

If you turn off the Print Spooler service – Windows/driver-based printing stops. This goes for one user printing directly to a local printer (USB/IP) or a shared printer hosted by a print server. If the Print Spooler on either client or server machines goes off – no “conventional” printing is happening.

Workarounds include:

  • CLI job submission via LPR command (if LPR service is running on the client and LPD is running on printer)
  • Web-based upload (if the printer supports it)
  • SMTP/email job submission (if the printer supports it)

All of the above bypass the Windows Print Spooler service. If standard Windows driver-based printing is needed – it won’t happen if the Print Spooler service isn’t running.

It’s even written in the description of the Windows Print Spooler service itself:

This service spools print jobs and handles interaction with the printer. If you turn off this service, you won’t be able to print or see your printers.

I expect Steve and Leo will address this in episode 827.

1 Like

I don’t believe you are correct. The printer driver configuration has radio buttons to print directly to an ATTACHED printer. If the printer is not attached, then what you said may be correct, you may need the spooler to print to network printers. I believe it may be driver specific.

Unfortunately for me I have only one printer and it is connected to my network and not a PC, so I don’t have the option to use it as a directly connected printer. Even still, I am able to see the necessary setting, it’s just grayed out:

I don’t believe you are correct.

That you can get at the dialog box that shows the settings of your HP Color LaserJet indicates to me that the Windows Print Spooler service on your computer is running. Otherwise, you should get a message like PIc # 1 below when you try to access a given printer’s printer properties:

Regarding your point about locally attached (USB) vs. network. It makes no difference, in my experience as I have multiple printers with multiple connection types on my Win 10 x64 machine (USB; IP; shared from print server). See Pic #2 (above) - as you can see, this is a locally attached USB printer as denoted by the port type.

Regarding the “Print directly to the printer” setting: I suspect this option is dimmed on your system because you’re using a type 4 driver. Switch to a type 3 driver, and this option should be available to you. See Pic #3 (above).

But regardless of Type 3/Type 4 drivers; USB vs. network/IP vs. shared from a print server; Print directly to printer or not — none of that matters. Bottom line: If the Print Spooler service isn’t running on your computer – you can’t print using the Windows printing system. The Print Spooler service is what lets Windows interact with the system’s installed printers. and their drivers.

But don’t take my word for it – you can read it for yourself on your own computer in the Print Spooler service’s description:

If you can’t see it from the screenshot in Pic #4 (above), it reads as follows: This service spools print jobs and handles interaction with the printer. If you turn off this service, you won’t be able to print or see your printers.

Q.E.D.

That said – I’d be very interested to see how you’re able to print using the Windows printing system on a Windows 10 machine that has its Print Spooler service disabled.

Cheers, SH

Well to be clear, I haven’t done anything to the spooler as my printer is a network printer and I need it to work, and I don’t believe I could print to it directly as it’s not directly attached, and so I haven’t disabled the print spooler. I was/am relying on reports of others saying they have disabled the spooler and gotten that option to work, but as we can both see it’s very complex, and no doubt the reports are potentially flawed. It’s a bit of a sh*tshow to be honest, and Microsoft should really start over on printing and update it for modern times. (But that would presume that printer manufacturers would play along, and they probably wouldn’t.)

Re: Microsoft should really start over on printing and update it for modern times. (But that would presume that printer manufacturers would play along, and the probably wouldn’t.)

Interestingly, they kind of have (in a way). They launched something called Universal Print in March. It’s more for the corporate set (requires M365) to eliminate print servers by leveraging cloud and IPPS. Most manufacturers are on board.

Kind of makes me sad Google discontinued Cloud Print. Especially after all the printer manufacturers built it into their computers. Harumph.