hessam Posted November 15, 2012 Posted November 15, 2012 Hi,i need vbs script to manage windows xp servicelike automatic,Manual,Disabled,Start,Stop,Pause,ResumeExample 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.
Yzöwl Posted November 15, 2012 Posted November 15, 2012 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'
hessam Posted November 15, 2012 Author Posted November 15, 2012 (edited) Hello,about manage i say that i need change state of service to ,automatic,Manual,Disabled,Start,Stop,Pause,Resumei 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 servivealso i stopped DNS Client service but some time i need to use ipconfig /flushdns commandso this service must be started.so i need vbs script to start this service from desktop then from cmd use the commandthen run script to stop again this servicealso i need to pause Telephony service on startup.so i dont want use gui like 'services.msc'thanks, Edited November 15, 2012 by hessam
Yzöwl Posted November 15, 2012 Posted November 15, 2012 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.
hessam Posted November 16, 2012 Author Posted November 16, 2012 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 likingfrist thanks for response and help me sory my english no so goodin my system must service disaled.yes but i want do it with seprate scriptexample for DNS Client,it always disabled and stopped in my system.so we know state of itthen 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 folderand i know if disable some service like Telephony or DHCP Client that cause prblemlike acquire internet connection address error.so we know waht servive we need and state of thatIn 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 namethen 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 methodIn 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"
jaclaz Posted November 16, 2012 Posted November 16, 2012 Idea. See if nirsoft nircmd command "service" would do:http://www.nirsoft.net/utils/nircmd.htmlhttp://www.nirsoft.net/utils/nircmd2.html#usingjaclaz
hessam Posted November 17, 2012 Author Posted November 17, 2012 (edited) Thank you very much jaclaz. that great and easy to usei maked cmd file and put below line on it.this a for pause Telephony service.nircmdc service pause TapiSrvthis for DNS Clientservice start DnscacheEveryBody need to know what is it best state of service,see below linkhttp://www.theeldergeek.com/services_guide.htmalso see below for service name to uset with nircmdServiceName 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 ExtensionsWmiApSrv WMI Performance Adapter wscsvc Security Center wuauserv Automatic Updates WZCSVC Wireless Zero Configuration xmlprov Network Provisioning Service Edited November 17, 2012 by hessam
jaclaz Posted November 17, 2012 Posted November 17, 2012 Thank you very much jaclaz. that great and easy to useGood .Just for the record, there is also a small nirsoft GUI app, Serviwin:http://www.nirsoft.net/utils/serviwin.htmltha will show (and can output as list) all services (and their "DisplayName"s, that may change on localized versions) .jaclaz
bphlpt Posted November 17, 2012 Posted November 17, 2012 (edited) EveryBody need to know what is it best state of service,see below linkhttp://www.theeldergeek.com/services_guide.htmIn 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 November 17, 2012 by bphlpt
hessam Posted November 17, 2012 Author Posted November 17, 2012 nirsoft provide small,useful,easy to use software thanks jaclazthanks bphlpt for Black Viper's x86 XP SP3 linkThis is All My Need that nircmd solved my problemsave it in *.cmd :: Pause Telephony Service ::nircmdc service pause TapiSrv:: Start And Enable DNS Client Service ::nircmdc service auto Dnscachenircmdc 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 Dnscachenircmdc service disabled Dnscache
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now