Jump to content

vbs script for manage windows xp service and registry


Recommended Posts

Hi,

i need vbs script to manage windows xp service

like automatic,Manual,Disabled,Start,Stop,Pause,Resume

Example For Task Scheduler Service.

also i need vbs script to put below registry in a vbs file and silently Apply To the registry

[HKEY_CURRENT_USER\Software\KMPlayer\WideAlbum\(Default Album)]

@="Playlist\\Default.kpl"

Thanks Best Regards.

Link to comment
Share on other sites


Please be more specific, 'manage' is too vague.

You need to tell us a specific purpose for the vbscript, to have something which can interactively configure both start and state is to have a GUI. We already have that with 'services.msc'

Link to comment
Share on other sites

Hello,

about manage i say that i need change state of service to ,automatic,Manual,Disabled,Start,Stop,Pause,Resume

i know about 'services.msc' .but i want vbs script to put in startup to run it from there. also i take less time to manage windows servive

also i stopped DNS Client service but some time i need to use ipconfig /flushdns command

so this service must be started.so i need vbs script to start this service from desktop then from cmd use the command

then run script to stop again this service

also i need to pause Telephony service on startup.

so i dont want use gui like 'services.msc'

thanks,

Edited by hessam
Link to comment
Share on other sites

I'm not sure that you understood the point I was making so I'll try to put it a different way. You are asking for a script which can stop a service, not a specific service but one or several of your choice at a time or times of your choosing and from either the desktop or start up location. It must also be able to start services, pause services and resume them too.

In order for your script to be able to take a Service or Display Name of your choosing (as input), enumerate its state and start up settings, and present them for you in a manner for you to customise to your liking. It would need to be interactive, (it would have to be in a question and answer format). To do this it could be a basic question with written answer format or a more elaborate GUI with drop down boxes or toggles.

In order to perform the changes your script would need to be able to determine whether or not your chosen service is capable of starting, stopping or pausing or resuming, (and has actually done so if chosen). It would need to check for dependencies which may be affected by or may themselves affect the selection you've chosen.

To have a non interactive method would mean creating separate scripts for each task you want to perform, and since there are already methods of doing this using NET.EXE or SC.EXE you may be just as well advised creating small batch files than vb scripts using WMI.

Link to comment
Share on other sites

I'm not sure that you understood the point I was making so I'll try to put it a different way.

You are asking for a script which can stop a service, not a specific service but one or several

of your choice at a time or times of your choosing and from either the desktop or start up location.

It must also be able to start services, pause services and resume them too.

In order for your script to be able to take a Service or Display Name of your choosing (as input),

enumerate its state and start up settings, and present them for you in a manner for you to customise

to your liking

frist thanks for response and help me sory my english no so good

in my system must service disaled.

yes but i want do it with seprate script

example for DNS Client,it always disabled and stopped in my system.so we know state of it

then i need scritp to enable and start it.

then need another script to disable and stop it.

and another one is a Telephony service that is always in manual and strated sate in my pc.

even if i pause it,that started on next pc boot.

so i want just make one another one script to pause it then put it in my startup folder

and i know if disable some service like Telephony or DHCP Client that cause prblem

like acquire internet connection address error.so we know waht servive we need and state of that

In order for your script to be able to take a Service or Display Name of your choosing (as input),

enumerate its state and start up settings, and present them for you in a manner for you to customise

to your liking. It would need to be interactive, (it would have to be in a question and answer format).

To do this it could be a basic question with written answer format or a more elaborate GUI with drop down boxes or toggles.

so that mean when i launch script its get service name

then that ask me waht to do?its not bad but i thinks scripting this get alot time.

but if we know name and state of servive i choice frist method

In order to perform the changes your script would need to be able to determine whether or not your chosen

service is capable of starting, stopping or pausing or resuming, (and has actually done so if chosen).

It would need to check for dependencies which may be affected by or may themselves affect the selection you've chosen.

To have a non interactive method would mean creating separate scripts for each task you want to perform,

and since there are already methods of doing this using NET.EXE or SC.EXE you may be just as well advised

creating small batch files than vb scripts using WMI.

also batch file not bad but in hiden mode or scripting using WMI not bad.

also what about

vbs script to put below registry in a vbs file and silently Apply To the registry

[HKEY_CURRENT_USER\Software\KMPlayer\WideAlbum\(Default Album)]

@="Playlist\\Default.kpl"

Link to comment
Share on other sites

Thank you very much jaclaz. that great and easy to use

i maked cmd file and put below line on it.

this a for pause Telephony service.

nircmdc service pause TapiSrv

this for DNS Client

service start Dnscache

EveryBody need to know what is it best state of service,see below link

http://www.theeldergeek.com/services_guide.htm

also see below for service name to uset with nircmd

ServiceName DisplayName

----------- -----------

Alerter Alerter

ALG Application Layer Gateway Service

AppMgmt Application Management

aspnet_state ASP.NET State Service

AudioSrv Windows Audio

BITS Background Intelligent Transfer Service

Browser Computer Browser

CiSvc Indexing Service

ClipSrv ClipBook

clr_optimization_v2.0.50727_32 .NET Runtime Optimization Service v2.0.50727_X86

COMSysApp COM+ System Application

CryptSvc Cryptographic Services

DcomLaunch DCOM Server Process Launcher

Dhcp DHCP Client

dmadmin Logical Disk Manager Administrative Service

dmserver Logical Disk Manager

Dnscache DNS Client

DynDNS Updater DynDNS Updater

ERSvc Error Reporting Service

Eventlog Event Log

EventSystem COM+ Event System

FastUserSwitchingCompatibility Fast User Switching Compatibility

FontCache3.0.0.0 Windows Presentation Foundation Font Cache 3.0.0.0

helpsvc Help and Support

HidServ Human Interface Device Access

hpdj hpdj

hpdj3500 hpdj3500

HTTPFilter HTTP SSL

idsvc Windows CardSpace

ImapiService IMAPI CD-Burning COM Service

lanmanserver Server

lanmanworkstation Workstation

LmHosts TCP/IP NetBIOS Helper

MDM Machine Debug Manager

Messenger Messenger

mnmsrvc NetMeeting Remote Desktop Sharing

MSDTC Distributed Transaction Coordinator

MSIServer Windows Installer

NetDDE Network DDE

NetDDEdsdm Network DDE DSDM

Netlogon Net Logon

Netman Network Connections

NetTcpPortSharing Net.Tcp Port Sharing Service

Nla Network Location Awareness (NLA)

nlsvc NetLimiter

NtLmSsp NT LM Security Support Provider

NtmsSvc Removable Storage

ose Office Source Engine

PlugPlay Plug and Play

PolicyAgent IPSEC Services

ProtectedStorage Protected Storage

RasAuto Remote Access Auto Connection Manager

RasMan Remote Access Connection Manager

RDSessMgr Remote Desktop Help Session Manager

RemoteAccess Routing and Remote Access

RemoteRegistry Remote Registry

rpcapd Remote Packet Capture Protocol v.0 (experimental)

RpcLocator Remote Procedure Call (RPC) Locator

RpcSs Remote Procedure Call (RPC)

RSVP QoS RSVP

SamSs Security Accounts Manager

SCardSvr Smart Card

Schedule Task Scheduler

seclogon Secondary Logon

SENS System Event Notification

SharedAccess Windows Firewall/Internet Connection Sharing (ICS)

ShellHWDetection Shell Hardware Detection

Spooler Print Spooler

srservice System Restore Service

SSDPSRV SSDP Discovery Service

stisvc Windows Image Acquisition (WIA)

SwPrv MS Software Shadow Copy Provider

SysmonLog Performance Logs and Alerts

TapiSrv Telephony

TermService Terminal Services

Themes Themes

TlntSvr Telnet

TrkWks Distributed Link Tracking Client

upnphost Universal Plug and Play Device Host

UPS Uninterruptible Power Supply

VSS Volume Shadow Copy

W32Time Windows Time

WebClient WebClient

winmgmt Windows Management Instrumentation

WmdmPmSN Portable Media Serial Number Service

Wmi Windows Management Instrumentation Driver Extensions

WmiApSrv WMI Performance Adapter

wscsvc Security Center

wuauserv Automatic Updates

WZCSVC Wireless Zero Configuration

xmlprov Network Provisioning Service

Edited by hessam
Link to comment
Share on other sites

EveryBody need to know what is it best state of service,see below link

http://www.theeldergeek.com/services_guide.htm

In addition to the link you provided, another very excellent source of service info is Black Viper's x86 XP SP3. Black Viper also has suggested service settings for all Windows OS from Win2K through Win8. (He has been around a long time and is well known.) In addition to the various suggestions and tools available on his site, his recommendations have even been incorporated into a tool to set all the service settings up for you to either his Safe, Tweaked, or BareBones settings with just a single step. That free tool is SMART. It works with XP, Vista and Win7. Just another option.

Cheers and Regards

Edited by bphlpt
Link to comment
Share on other sites

nirsoft provide small,useful,easy to use software thanks jaclaz

thanks bphlpt for Black Viper's x86 XP SP3 link

This is All My Need that nircmd solved my problem

save it in *.cmd

:: Pause Telephony Service ::

nircmdc service pause TapiSrv

:: Start And Enable DNS Client Service ::

nircmdc service auto Dnscache

nircmdc service start Dnscache

::flushed the DNS Resolver Cache::

::And if Start And Enable DNS Client::

::Service worked you get this info::

::Successfully flushed the DNS Resolver Cache.::

ipconfig /flushdns

:: Stop And Disable DNS Client Service ::

nircmdc service stop Dnscache

nircmdc service disabled Dnscache

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...