Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

command line questions

Featured Replies

Hey everyone,

I'm trying to make some batch files that you can run to toggle the status of a service (in particular, the print spooler).

I'd like to make the batch file something like...

@echo off

IF "print service started" (

net stop spooler

) ELSE (

net start spooler

I'd like to keep my spooler service disabled unless I need to print something (usually only with Acrobat PDF) and I'd like a quick link to do this from the start menu or such.

Any help would be appreciated.

Thanks!


best way would IMO be to check the status of it via registry.. do a read from reg

i think the cmd is:

set test REG READ key /v subkey /d value

if %test% = 2 goto good ELSE goto BAD

exit

:net stop spooler

2 = auto

3 = manual

4 = disabled

find the services reg key for spooler

I think you're gonna have many tips for that.

There's mine...

@echo off

FOR /F "tokens=1,2,3,4" %%A IN ('SC.EXE QUERY SPOOLER ^| FIND /I "STATE"') DO SET STATE=%%D

IF /I "%STATE%"=="RUNNING" (NET STOP SPOOLER) ELSE (NET START SPOOLER)

yours looks better jdoe :P much more professional :P

  • Author

Awesome!!! This is exactly what I wanted...

Thanks a million.

:D:D:D

yours looks better jdoe :P much more professional :P

Your idea was not bad but reading the start value of a service don't give the live state of this service. The start value can be "2" (automatic) and the service can also be in a stopped state. ;)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.